Message148704
| Author |
ezio.melotti |
| Recipients |
docs@python, eric.araujo, ezio.melotti, meador.inge, peter.otten, terry.reedy |
| Date |
2011年12月01日.05:23:24 |
| SpamBayes Score |
9.290135e-11 |
| Marked as misclassified |
No |
| Message-id |
<1322717005.66.0.908101980062.issue13510@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
FWIW I've seen several persons using "for line in file.readlines(): ..." or even "while 1: line = file.readline()". IMHO it's a good idea to document that "without sizehint, it's equivalent to list(file)" and that "for line in file: ..." can be used directly. Even if some people don't read the doc, the ones who do will benefit from this. The same note might also be added to the docstring (I think it's somewhat common to learn about readlines() through dir(file) + help(file.readlines)). |
|