[Python-checkins] CVS: python/nondist/peps pep-0234.txt,1.6,1.7
Guido van Rossum
gvanrossum@users.sourceforge.net
Fri, 27 Apr 2001 08:26:57 -0700
Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv24805
Modified Files:
pep-0234.txt
Log Message:
BDFL pronouncement on next() vs. __next__() vs. __call__().
Add mailing list pointers.
Add discussion on "once-stopped-always-stopped".
Index: pep-0234.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0234.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** pep-0234.txt 2001/04/26 21:50:09 1.6
--- pep-0234.txt 2001/04/27 15:26:54 1.7
***************
*** 112,116 ****
there are other important protocols with a user-level name
(e.g. keys()), and I don't see the importance of this particular
! rule.
--- 112,116 ----
there are other important protocols with a user-level name
(e.g. keys()), and I don't see the importance of this particular
! rule. BDFL pronouncement: this topic is closed. next() it is.
***************
*** 161,164 ****
--- 161,172 ----
better name for the second operation though.
+ - There's a bit of undefined behavior for iterators: once a
+ particular iterator object has raised StopIteration, will it
+ also raise StopIteration on all subsequent next() calls? Some
+ say that it would be useful to require this, others say that it
+ is useful to leave this open to individual iterators. Note that
+ this may require an additional state bit for some iterator
+ implementations (e.g. function-wrapping iterators).
+
- It was originally proposed that rather than having a next()
method, an iterator object should simply be callable. This was
***************
*** 166,170 ****
clarity: if you don't know the code very well, "x = s()" does
not give a hint about what it does; but "x = s.next()" is pretty
! clear.
--- 174,178 ----
clarity: if you don't know the code very well, "x = s()" does
not give a hint about what it does; but "x = s.next()" is pretty
! clear. BDFL pronouncement: this topic is closed. next() it is.
***************
*** 297,300 ****
--- 305,320 ----
{__getitem__, keys, values, items}.
+
+ Mailing Lists
+
+ The iterator protocol has been discussed extensively in a mailing
+ list on SourceForge:
+
+ http://lists.sourceforge.net/lists/listinfo/python-iterators
+
+ Initially, some of the discussion was carried out at Yahoo;
+ archives are still accessible:
+
+ http://groups.yahoo.com/group/python-iter
Copyright