Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #31612
| From | Mark Lawrence <breamoreboy@yahoo.co.uk> |
|---|---|
| Subject | Re: A desperate lunge for on-topic-ness |
| Date | 2012-10-18 10:12 +0100 |
| References | <CANaSqUfLX7V2OxhO+fdVtmQcDzNfEgQfutHak_G-9_1_4nNr1Q@mail.gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2413.1350551564.27098.python-list@python.org> (permalink) |
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 > point]: > > 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 > parentheses. > > 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? > > -[]z. > 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." -- Cheers. Mark Lawrence.
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: A desperate lunge for on-topic-ness Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-10-18 10:12 +0100
csiph-web