Issue1305

classification
Title: Confusing error message calling generator.next() with arguments
Type: behaviour Severity: minor
Components: Core Versions: Jython 2.7, Jython 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: fwierzbicki, nriley, pjenvey
Priority: Keywords:

Created on 2009-04-07.15:20:19 by nriley, last changed 2013-02-19.18:21:41 by fwierzbicki.

Messages
msg4463 (view) Author: Nicholas Riley (nriley) Date: 2009-04-07.15:20:18
def gen():
    yield True

gen().next(1)

On CPython this gives "TypeError: expected 0 arguments, got 1".

On Jython, this gives "TypeError: next() takes exactly one argument (1 given)"

Note that this works fine with iterators, where Jython produces "TypeError: next(): 
expected 0 args; got 1".
msg4471 (view) Author: Philip Jenvey (pjenvey) Date: 2009-04-07.19:35:31
I remember seeing this before, it's a bug with in the error handling by 
the exposed method handle. I think it's including self in the count
History
Date User Action Args
2013-02-19 18:21:41fwierzbickisetversions: + Jython 2.5, Jython 2.7
2009-08-09 02:37:26fwierzbickisetnosy: + fwierzbicki
2009-04-07 19:35:31pjenveysetnosy: + pjenvey
messages: + msg4471
2009-04-07 15:20:19nrileycreate