A desperate lunge for on-topic-ness
breamoreboy at yahoo.co.uk
Thu Oct 18 11:12:39 CEST 2012
On 18/10/2012 07:06, Zero Piraeus wrote:
> Okay, so, first thing vaguely Python-related that comes to mind [so
> probably not even slightly original, but then that's not really the
> 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.
> 2. Say "screw it" and break the line using a backslash.
> 3. Say "well, at least it's not a backslash" and break the line using
> 4. Spend 45 minutes trying to think up shorter [but still sensible]
> variable names to make it fit.
> 5. Perform an otherwise pointless assignment to a temp variable on the
> previous line to make it fit.
> 6. Realise that if it's that long, it probably shouldn't have been a
> list comprehension in the first place.
> Any I've missed? Any preferences?
I suggest re-reading PEP 8, particularly the section titled "A Foolish
Consistency is the Hobgoblin of Little Minds" and specifically the first
sentence of the third paragraph "But most importantly: know when to be
inconsistent -- sometimes the style guide just doesn't apply."
More information about the Python-list