Best way to split up lines - RE: About the 79 character line recommendation

Michael Yanowitz m.yanowitz at kearfott.com
Thu Dec 7 07:02:50 EST 2006


Hello:

   I too don't like large lines. However in the following case, and
multi-level indentations, I find it unavoidable.
   Here is one huge statement I haven't been able to split onto multiple
lines.
What would be the best way to split the following line (Python doesn't like
me
to split it up between the comma-separated parameters):

    top, ip1, ip2, ip3, ip4, messageCounter, ackRequired, dataType, utc1,
utc2, utc3, utc4, utc5, utc6, utc7, utc8, utc9, utc10, utc11, utc12, st1,
st2, st3, st4, st5, st6, numberOfLabels, dataWord =
struct.unpack("!H4BH20BHI", strMessage)


Thanks in advance:
Michael Yanowitz


-----Original Message-----
From: python-list-bounces+m.yanowitz=kearfott.com at python.org
[mailto:python-list-bounces+m.yanowitz=kearfott.com at python.org]On Behalf
Of Ramon Diaz-Uriarte
Sent: Wednesday, December 06, 2006 5:12 PM
To: Steve Bergman
Cc: python-list at python.org
Subject: Re: About the 79 character line recommendation


On 5 Dec 2006 13:28:22 -0800, Steve Bergman <steve at rueb.com> wrote:

(...)
>
> I'm finding 100 to be a nice balance.  It forces me not to be lazy and
> allow really long lines, but allows me to format so as to make the
> meaning most clear.
>



But if you use some advanced editors (such as Emacs) that easily allow
you to see/edit the same file in two buffers side by side, then going
beyond 80 chars is often a bad idea, specially if you use a laptop.
(And, of course, there is the eternal issue of doing a simple "a2ps"
to print some code; longer than 80 and you often have hard to read
pages).

Best,

R.

--
Ramon Diaz-Uriarte
Statistical Computing Team
Structural Biology and Biocomputing Programme
Spanish National Cancer Centre (CNIO)
http://ligarto.org/rdiaz
--
http://mail.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list