[Python-ideas] iterable: next() and __iter__() -- and __reset()

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Mar 4 23:48:06 CET 2010


spir wrote:

> (2) But: for any reason next() is not spelled as a "magic" method. If 
> this method becomes the distinctive method of iterables, then it 
> should be called __next__() for consistency.

I gather that it is indeed called __next__() in Py3, and there
is a new builtin function next() for invoking it.

-- 
Greg



More information about the Python-ideas mailing list