[Python-Dev] PEP 8 modernisation

Barry Warsaw barry at python.org
Thu Aug 1 17:35:38 CEST 2013


On Aug 01, 2013, at 11:05 AM, Alexander Belopolsky wrote:

>I will start experimenting with 100-char limit, but I think it is still too
>wide for auto-wrapped text.   Maybe we should have a stronger
>recommendation to keep 80-char limit for docstrings and other embedded
>text.   It is OK to have an occasional long line in code,  but readability
>suffers when you have every line close to 100 chars.

In general, long lines are a smell that the code is trying to express
something too complex or is being too clever.  Using various strategies
judiciously usually leads to better, more readable code (e.g. use a local
variable, wrap the line after open parens, don't chain too many calls, etc.)

I'm not counting exceptions of course, it's PEP 8 after all!

So I would greatly prefer that stdlib files be kept to the 79 character
limit.  I see most violations of this in the library documents, but especially
there, paragraphs should be wrapped to 79 characters, and can easily be done
without losing expressability.

Cheers,
-Barry


More information about the Python-Dev mailing list