[Python-ideas] PEP 8 update on line length
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Feb 21 03:30:08 EST 2019
Brendan Barnwell wrote:
> I use
> an editor that VISUALLY wraps long lines and maintains the indentation
> on the wrapped portion, without changing the bytes in the file. I make
> my lines as long as I want, inserting linebreaks only where they have a
> semantic reason to be (such as between multiple long conditions in an
> "if").
I don't think that taking an excessively long line of code and
mechanically wrapping it to a narrower width makes in any easier
to read. Like you say, readability relies on making intelligent
decisions about where to break lines based on their semantics.
So even if everyone is equipped with an auto-wrapping code editor,
there is still going to be code that really needs at least N
characters of width to display properly, and looks terrible when
wrapped to anything less.
Think about how annoying it is when an email message gets
re-wrapped to a slightly narrower width than it was originally
written with -- and apply that to code.
--
Greg
More information about the Python-ideas
mailing list