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

Peter Otten __peter__ at web.de
Wed Nov 30 18:53:56 CET 2011


Éric Araujo wrote:

> Okay.  You can open a report on bugs.python.org to ask that the doc for
> readlines mention list(fp) as an alternative.

That would make sense to me only if readlines() were deprecated. I did 
something slightly different, propose a hint that the user should avoid 
readlines() in a for-loop, see

http://bugs.python.org/issue13510




More information about the Python-ideas mailing list