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

Guido van Rossum guido@python.org
2002年7月15日 19:48:02 -0400


> > I don't think so. We should pick the most convenient chunking for the
> > default iterator
>> But we're talking here about making the file object
> *be* an iterator itself, not just have a "default
> iterator". If that's to happen, all the
> other ways of iterating over a file ought to be
> implemented on top of the basic iteration facility
> provided by the file object -- lest we get unfortunate
> interactions between the different iteration methods
> a la xreadlines(). To me, this implies that the file
> object must iterate by bytes.

Why should all iteration over a file be defined in terms of its basic
iteration? I don't see that as dogma.
--Guido van Rossum (home page: http://www.python.org/~guido/)

AltStyle によって変換されたページ (->オリジナル) /