[Python-Dev] PEP 8 modernisation
R. David Murray
rdmurray at bitdance.com
Thu Aug 1 17:52:10 CEST 2013
On Thu, 01 Aug 2013 11:35:38 -0400, Barry Warsaw <barry at python.org> wrote:
> 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.
The documentation often has line lengths longer than 80 chars for two
reasons: (1) the original translation from TeX was done by a script, and
the script had a bug in it that made the lines slightly too long, and no
one noticed in time and (2) until relatively recently Sphinx didn't
support wrapping prototype lines (it now does).
So as we edit the docs, we re-wrap. Just like we do with the legacy
The code examples in the docs are a bit trickier, since if you wrap the
source to 79 you wind up with even-shorter-than-79 wrapping in the
actual code lines, which can look odd when the text is rendered. So
there it's a judgement call...but I still generally try to wrap the
source to 79, sometimes refactoring the example to make that more
elegant. Which, as you point out, often makes it better as well :).
More information about the Python-Dev