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

Neil Schemenauer nas at arctrix.com
Tue Mar 6 02:29:31 CET 2007


Ka-Ping Yee <python-dev at zesty.ca> wrote:

This is exactly why the iterator protocol method should be named next: so it can't collide with method names used for other purposes.

And yet people are suggesting that call be used instead of next. If people believe iterators should be separate objects then there is no problem with name collisions. Even if you don't believe in always using separate iterator objects, using one is not such a big burden in the case of name collisions.

The argument that all "protocol" methods should have double underscore names seems to be pretty weak too. It's only an appeal for consistency, I think. We don't suggest that file-like objects should implement read() instead of read(), for example.

Neil



More information about the Python-3000 mailing list