[Python-3000] Fwd: Re: PEP: rename it.next() to it.next(), add a next() built-in (original) (raw)
Raymond Hettinger python at rcn.com
Tue Mar 6 00:46:57 CET 2007
- Previous message: [Python-3000] Fwd: Re: rename it.next() to it.__next__(), add a next() built-in
- Next message: [Python-3000] Exception tracebacks and PEP 3101
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Josiah Carlson]
I have written methods named 'next' which have nothing to do with the iterator protocol.
[Greg]
That would be another reason for renaming .next() to .next() -- to avoid intruding on the user's namespace.
Another read is that iterators should be separate objects so that the namespace is coherent (with iter, next, and whatnot all being iterator related). Who is going to create a custon iterator that defines BOTH next and next(), that would be less than ideal and not something we want to encourage.
Raymond
- Previous message: [Python-3000] Fwd: Re: rename it.next() to it.__next__(), add a next() built-in
- Next message: [Python-3000] Exception tracebacks and PEP 3101
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]