[Python-checkins] CVS: python/nondist/peps pep-0234.txt,1.11,1.12
Guido van Rossum
gvanrossum@users.sourceforge.net
Tue, 01 May 2001 04:47:31 -0700
Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv2984
Modified Files:
pep-0234.txt
Log Message:
Add proposal to make files their own iterator.
Index: pep-0234.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0234.txt,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** pep-0234.txt 2001/05/01 11:42:07 1.11
--- pep-0234.txt 2001/05/01 11:47:29 1.12
***************
*** 255,258 ****
--- 255,265 ----
iterator implementations (e.g. function-wrapping iterators).
+ - It has been proposed that a file object should be its own
+ iterator, with a next() method returning the next line. This
+ has certain advantages, and makes it even clearer that this
+ iterator is destructive. The disadvantage is that this would
+ make it even more painful to implement the "sticky
+ StopIteration" feature proposed in the previous bullet.
+
- Some folks have requested extensions of the iterator protocol,
e.g. prev() to get the previous item, current() to get the