13 ms·
Not python, but in Java, identifiers can get quite long. e.g.: "localizableRUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH" is the longest at 66 charact
by fnord123 10y ago
Not python, but in Java, identifiers can get quite long. e.g.: "localizableRUNTIME_MODELER_PORTNAME_SERVICENAME_NAMESPACE_MISMATCH" is the longest at 66 characters.
As for python, some fancy list comprehensions get rather long rather quickly. Especially if itertools are involved as you izip, etc. Or using useful variable names (i.e. not 'fcnt', 'tcnt') while destructuring as in this example from pyspark/mllib:
(failure_count, test_count) = doctest.testmod(globs=globs, optionflags=doctest.ELLIPSIS)
I adapted your grep to:
find . -name '*.py' | xargs grep -n '^ *.\{80\}'
So leading indentation doesn't mess with the results.
- raverbashing 10y agoBut the 80 characters limit includes indentation
- pvg 10y agoLeading indentation is very much a part of the results especially in a language like python where the indentation is syntactically significant. You can't just decide to toss it to make a line shorter.
- dozzie 10y ago> As for python, some fancy list comprehensions get rather long rather quickly. Sure, and we all know that indentation in Python is not allowed for list comprehensions. class Foo: # ... def bar(): # ... if baz: # ... result = [ y.strip()[1:14].replace("this", "that") for x in nabla.generate(q, w, y, z) for y in x.something_other() if y.has_property(...) ]
- dood 10y agoPreventing people making unreadable list comprehensions is exactly the sort of thing the 80 character limit is for ;)