[Python-Dev] Single- vs. Multi-pass iterability

Greg Ewing greg@cosc.canterbury.ac.nz
Fri, 19 Jul 2002 12:48:47 +1200 (NZST)


Alex Martelli <aleax@aleax.it>:

> Me:
> 
> Then the term "iterator" could have been reserved
> > for the special case of an object that provides stream
> > access to a random-access collection.
> 
> > Nice touch, except that I keep quibbling on the "random
> > access" need -- see my previous msg about sets.

Well, substitute the term "non-destructively readable"
or "multi-pass capable" or something like that if
you prefer.

> Seekable files can be multi-pass, but in the strict sense
> that you can rewind them -- it's still impractical to have
> them produce multiple *independent* iterators (needing
> some sort of in-memory caching).

Yes, that's the key idea I had in mind. So make it
"independent multi-pass capable". :-)

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+