Re: A desperate lunge for on-topic-ness

Discussion in 'Python' started by Mark Lawrence, Oct 18, 2012.

  1. 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.
     
    Mark Lawrence, Oct 18, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Zero Piraeus

    A desperate lunge for on-topic-ness

    Zero Piraeus, Oct 18, 2012, in forum: Python
    Replies:
    24
    Views:
    368
    Krzysztof Voss
    Oct 19, 2012
  2. Chris Angelico

    Re: A desperate lunge for on-topic-ness

    Chris Angelico, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    150
    Chris Angelico
    Oct 18, 2012
  3. Demian Brecht

    Re: A desperate lunge for on-topic-ness

    Demian Brecht, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    196
    Demian Brecht
    Oct 18, 2012
  4. Jean-Michel Pichavant

    Re: A desperate lunge for on-topic-ness

    Jean-Michel Pichavant, Oct 18, 2012, in forum: Python
    Replies:
    2
    Views:
    172
    Demian Brecht
    Oct 19, 2012
  5. Chris Angelico

    Re: A desperate lunge for on-topic-ness

    Chris Angelico, Oct 18, 2012, in forum: Python
    Replies:
    0
    Views:
    163
    Chris Angelico
    Oct 18, 2012
Loading...

Share This Page