[Python-ideas] Is there a reason why file.readlines() doesn't/can't return an iterator?

Yuval Greenfield ubershmekel at gmail.com
Wed Nov 30 15:31:14 CET 2011


Since we marginally brushed the subject of backwards compatibility
damning...

I'm kind of surprised that files do that. Now that I check I'm surprised
that StringIO does that.

text = 'asdf\nword'
for item in StringIO(text):    !=    for item in text:

I'm not sure if I like that.

--Yuval
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20111130/46c8673f/attachment.html>


More information about the Python-ideas mailing list