[Python-ideas] 80 character line width vs. something wider

Lie Ryan lie.1296 at gmail.com
Thu May 21 10:04:55 CEST 2009


Raymond Hettinger wrote:

> 
>> Some people find their productivity is enhanced with an 80 character 
>> limit.
> 
> Perhaps this is true, though I've not heard one jot of evidence to 
> support it
> and certainly no evidence focusing on Python coding practices which are
> affected by the use of whitespace for control flow.  Nor have I seen 
> evidence
> of comparative productivity of 80 char limits versus 100 char limits.  
> All we
> have is anecdotal evidence and personal tastes.

This is how I will write program if we have 160 character limit:

def foo(f, a, b, c):
     return [[((f(x, y) * i, i) if i % 2 else 0) for i, x in 
enumerate(a) if f(y, x) == a + x] for y in [c(z) for z in range(a, a * b 
+ c, c)]]

except there will be no line breaks...

I love list comprehension so much that I often _unconsciously_ write a 
very complex list comprehensions. 80-character convention acts as a 
reminder to consider refactoring.




More information about the Python-ideas mailing list