Warning about "for line in file:"

Steven Majewski sdm7g at Virginia.EDU
Fri Feb 15 15:51:01 EST 2002


On Fri, 15 Feb 2002, Neil Schemenauer wrote:

> Russell E. Owen wrote:
> > The readline or xreadline file methods work fine, of course.
>
> Why "of course"?  iter(file) does the same thing as file.xreadlines().
> Have you tested xreadlines?
>

I also get the same behavior on any example I can contrive on
file iterators that I get with with either readlines or xreadlines.

Russell: could you post an example that shows the behaviour you're
seeing ?

-- Steve Majewski






More information about the Python-list mailing list