[Python-ideas] PEP 8 update on line length

Mike Müller mmueller at python-academy.de
Tue Feb 19 02:29:03 EST 2019


Am 19.02.19 um 05:37 schrieb Simon:
> Hello,
> 
> I'd like to propose an update to PEP8. Indeed, the 80 characters per line 
> guideline is, I feel, outdated.
> 
> I understand the need for it, back when monitors were small, and everyone
> coded on terminals, but nowadays, I feel like that guideline is more of a
> hinderance, and that it promotes poor code.
> 
> Indeed, people abiding by this rule tend to choose shorter variable names, 
> reduce the amount of indentation, and other tricks to just keep the
> character count under 80. I think a 100 or even 120 suggested characters per
> line count is much more realistic by today's standards. It still allow for
> the code to be completely displayed, even on just half of a screen.

If I read PEP8 correctly, the limit is effectively extended to 100 (well, 99)
characters already:

    Some teams strongly prefer a longer line length. For code maintained
    exclusively or primarily by a team that can reach agreement on this issue,
    it is okay to increase the nominal line length from 80 to 100 characters
    (effectively increasing the maximum length to 99 characters), provided that
    comments and docstrings are still wrapped at 72 characters.

https://www.python.org/dev/peps/pep-0008/


Mike


More information about the Python-ideas mailing list