PEP 234 little bug?

Hans Nowak wurmy at earthlink.net
Sat Mar 2 20:42:25 EST 2002


Michael 'Mickey' Lauer wrote:
> 
> Just read through some of the already implemented PEPs.
> 
> PEP 234 (iterators) states:
> 
> >    - 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.
> >
> >      Resolution: this has been implemented.
> 
> I can't see a next() in a file object. Shouldn't it be
> "Resolution: this has not been implemented." ?

Hm, I don't think so. I think it does not say that the *file*
object should have a next() method... rather, it says that
it's its own iterator, and the iterator has the next()
method. Maybe the wording could have been a bit more careful,
but essentially it's true what is says. And iterating over
files has indeed been implemented in 2.2.

-- 
Hans (base64.decodestring('d3VybXlAZWFydGhsaW5rLm5ldA==')) 
# decode for email address ;-)
The Pythonic Quarter:: http://www.awaretek.com/nowak/



More information about the Python-list mailing list