"Guido van Rossum" <[EMAIL PROTECTED]> wrote:
> On 3/5/07, Josiah Carlson <[EMAIL PROTECTED]> wrote:
> > because [...] 2) it renames a protocol method, making it
> > potentially difficult and/or buggy to write forward or backward
> > compatible code, [...]
> 
> Did you see my slides and/or video of my talk about Py3k yet? This
> change can be carried out automatically.

I read the slides.

However, I have written methods named 'next' which have *nothing* to do
with the iterator protocol.  I probably should have written them as
something like 'get_next' so as not to confuse later readers, but the
lack of an __iter__, specific documentation about what .next() means,
and the context in which it was written, read much better with .next()
than .get_next(), or any one of the handful of other names (and
alternate naming semantics) I considered at the time.


Barry Warsaw <[EMAIL PROTECTED]> wrote:
> Perhaps, but I think there's a valid use case for calling "next"  
> explicitly, and I would really hate for that to be spelled  
> "it.__next__()".

I agree, which is one of the reasons why I personally prefer the
status-quo: it.next() .  It works.  Has always worked.  And the 2to3
translator won't get confused by non-iterator-based .next() methods
(which I'm not claiming are common, merely that they exist).

 - Josiah

_______________________________________________
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