[Python-Dev] Minor ConfigParser Change

Fred L. Drake, Jr. fdrake at acm.org
Thu May 31 06:45:58 CEST 2007


On Saturday 26 May 2007, Joseph Armbruster wrote:
 > 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.

Before the current iteration support was part of Python, there was no way to 
iterate over a the way there is now; the code you've dug up is simply from 
before the current iteration support.  (As I'm sure you know.)

Is there motivation for these changes other than a stylistic preference for 
the newer idioms?  Keeping the SLOC count down seems pretty minimal, and 
unimportant.  Making the code more understandable is valuable, but it's not 
clear how much this really achieves that.

In general, we try to avoid making style changes to the code since that can 
increase the maintenance burden (patches can be harder to produce that can be 
cleanly applied to multiple versions).

Are there motivations we're missing?


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>


More information about the Python-Dev mailing list