This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Line iteration readability
Type: Stage:
Components: None Versions: Python 2.5
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, joearmbruster, rhettinger
Priority: normal Keywords: patch

Created on 2007-05-26 20:13 by joearmbruster, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
forline.patch joearmbruster, 2007-05-26 20:13
Messages (4)
msg52675 - (view) Author: Joseph Armbruster (joearmbruster) Date: 2007-05-26 20:13
I noticed there were several places that use the

while 1:

as opposed to the:

for line in fp:

approach to line-reading.  This patch takes care of some of them that I grep'd out.

msg52676 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2007-05-27 06:21
The patch is fine.  The first change should probably go a step further and use enumerate() for the lineno counts.
msg52677 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2007-05-27 06:39
On second thought, the change to ConfigParse should not go in.  The docs currently promise that any file-like object supporting readling() will be accepted .
msg61422 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-01-21 17:22
I also left out the changes to the ftplib and distutils functions since
they also accept file objects as parameters, to keep b/w compatibility.
Committed the rest as r60163.
Date User Action Args
2022-04-11 14:56:24adminsetgithub: 45002
2008-01-21 17:22:49georg.brandlsetstatus: open -> closed
assignee: georg.brandl
resolution: accepted
messages: + msg61422
nosy: + georg.brandl
2007-05-26 20:13:14joearmbrustercreate