Add proposal to make files their own iterator.

This commit is contained in:
Guido van Rossum 2001-05-01 11:47:29 +00:00
parent 427ddb1062
commit 392ff1769e
1 changed files with 7 additions and 0 deletions

View File

@ -254,6 +254,13 @@ Open Issues
Note that this may require an additional state bit for some
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
current item again, finished() to test whether the iterator is