[Tutor] Why next vs. __next__ ?
kent37 at tds.net
Tue Apr 22 04:15:30 CEST 2008
python at bdurham.com wrote:
> Is there a reason why generators have a special method named "next" vs.
> All other Python's special names have the double underscore
It's actually considered a mistake.
The original rationale is spelled out in PEP 234 - see the Resolved
It is being renamed to __next__() in Python 3.0 and there will be a
builtin next() method that calls it. Instead of iterator.next() you will
More information about the Tutor