15 Jul
2002
15 Jul
'02
9:15 a.m.
I think it's more complicated than that. If the file object were to become an object obeying the iterator protocol, its next() method should really return the next *byte* of the file. Then you'd still want methods like read(), readline() etc. for reading in larger chunks.
I don't think so. We should pick the most convenient chunking for the default iterator, and provide explicit ways to ask for other iterators (like dict iterators). Also, since "for line in file" already works, there's a strong precedent for iterating by line by default. --Guido van Rossum (home page: http://www.python.org/~guido/)