[Python-3000] PEP: rename it.next() to it.__next__(), add a next() built-in

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Mar 6 00:35:01 CET 2007


Josiah Carlson wrote:
> I have written methods named 'next' which have *nothing* to do
> with the iterator protocol.

That would be another reason for renaming .next() to
.__next__() -- to avoid intruding on the user's
namespace.

--
Greg


More information about the Python-3000 mailing list