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

Guido van Rossum guido@python.org
Thu, 11 Jul 2002 06:47:53 -0400


> > Proposal: make files really support the iterator
> > protocol. __iter__ would return self and next() would call
> > readline and raise StopIteration if ''.  If anyone wants the
> > xreadline performance improvement it should be explicit.

No.  I won't have "for line in file" be slower than attainable.

The only solution I accept is a complete rewrite of the I/O system
without using stdio, so xreadlines can be integrated.

--Guido van Rossum (home page: http://www.python.org/~guido/)