Add proposal to make files their own iterator.
This commit is contained in:
parent
427ddb1062
commit
392ff1769e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue