[Python-ideas] 80 character line width vs. something wider
Raymond Hettinger
python at rcn.com
Thu May 21 05:16:09 CEST 2009
> I don't think the 80-character limit in PEP-8 is doing many people a great deal of harm.
FWIW, I posted two recurring examples of where it is awkward in normal
python programming. One, raising exceptions with messages -- the message
doesn't typically start until 30th column or so. Two, in unittests using
self.assertRaises(SomeException, expr), the expr part doesn't typically
start until the 35th column or so. Also, there is a problem with indented
multiline string literals where the indentation is taking up space that will
never be shown to the end-user. Indented comments and in-line comments
are also space challenged.
I think the Google example is instructive. Their two space tabs are not a natural
preference for anyone I know. Instead, it is an accommodation born from trying
to fit nested, indented code into 80 columns. I'm pretty much in agreement with
the OP that going to 90 or 100 columns is a better solution.
Of course, if Hollerith punch cards come back into vogue, then the OP's
proposal won't work out so well ;-)
Raymond
More information about the Python-ideas
mailing list