[issue13510] Clarify that readlines() is not needed to iterate over a file

Chris Rebert report at bugs.python.org
Thu Oct 25 07:17:18 CEST 2012


Chris Rebert added the comment:

file.readlines() (and perhaps dare I say even file.readline()) should not even be mentioned in the tutorial, IMO. It is difficult to imagine a use case where just iterating over the file object isn't superior. I cannot remember the last time that I have used either of these methods. They ought to be relegated to the library docs. Presenting `for line in a_file:` as merely "An alternative approach" in the official tutorial is practically archaic.

----------
nosy: +cvrebert

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13510>
_______________________________________


More information about the Python-bugs-list mailing list