Kristján,

While we are on the topic of minor changes... :-)

I noticed that one of the parts of ConfigParser was not using "for line in fp" style of readline-ing :-) So, this will reduce the SLOC by 3 lines and improve readability. However, I did a quick grep and this type of practice appears in several other places.

There is a possibility of good savings in this department. If you think this is worthwhile, I can create one large patch for them all.

I sure hope I am not missing something fundamental with this one...

Joseph Armbruster
Index: Lib/ConfigParser.py
===================================================================
--- Lib/ConfigParser.py (revision 55600)
+++ Lib/ConfigParser.py (working copy)
@@ -441,10 +441,7 @@
         optname = None
         lineno = 0
         e = None                                  # None, or an exception
-        while True:
-            line = fp.readline()
-            if not line:
-                break
+        for line in fp:
             lineno = lineno + 1
             # comment or blank line?
             if line.strip() == '' or line[0] in '#;':
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to