Peek inside iterator (is there a PEP about this?)
Steven D'Aprano
steve at REMOVE-THIS-cybersource.com.au
Thu Oct 2 10:06:24 EDT 2008
On Wed, 01 Oct 2008 16:14:09 -0400, Terry Reedy wrote:
> Iterators are intended for 'iterate through once and discard' usages.
Also for reading files, which are often seekable.
I don't disagree with the rest of your post, I thought I'd just make an
observation that if the data you are iterating over supports random
access, it's possible to write an iterator that also supports random
access.
--
Steven
More information about the Python-list
mailing list