Ka-Ping Yee <[EMAIL PROTECTED]> 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

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to