[ python-Patches-1726198 ] Line iteration readability

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.python.patches
Message-ID <[email protected]>
Patches item #1726198, was opened at 2007-05-26 15:13
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1726198&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Joseph Armbruster (joearmbruster)
Assigned to: Nobody/Anonymous (nobody)
Summary: Line iteration readability

Initial Comment:
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.



----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2007-05-27 01:39

Message:
Logged In: YES 
user_id=80475
Originator: NO

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 .

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2007-05-27 01:21

Message:
Logged In: YES 
user_id=80475
Originator: NO

The patch is fine.  The first change should probably go a step further and
use enumerate() for the lineno counts.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1726198&group_id=5470
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.