A desperate lunge for on-topic-ness

Chris Angelico rosuav at gmail.com
Thu Oct 18 02:13:55 EDT 2012


On Thu, Oct 18, 2012 at 5:06 PM, Zero Piraeus <schesis at gmail.com> wrote:
> What are people's preferred strategies for dealing with lines that go
> over 79 characters? A few I can think of off the bat:
>
> 1. Say "screw it" and go past 79, PEP8 be damned.
>
> 6. Realise that if it's that long, it probably shouldn't have been a
> list comprehension in the first place.

Depending on how far past, I'd be most inclined to one of these. I
don't consider the eightieth character position to be sacrosanct, but
on the other hand, I'm not going to go thousands of characters to the
right. Most of my development screens will happily go to ~200
characters, definitely above 100, so I tend to write a bit wider than
PEP 8 demands. Generally I'd not look at splitting a line until it
goes over 100-120 characters. (And even then, I won't automatically
split it. I've been known to write some rather long lines of code.)
When I do split, it's usually by dividing the line into multiple
logical actions; if the split looks like type #5, I'll not split it.

ChrisA



More information about the Python-list mailing list