Python strings and coding conventions
mensanator at aol.com
Sun Jan 11 18:48:53 CET 2009
On Jan 11, 3:56�am, Marc 'BlackJack' Rintsch <bj_... at gmx.net> wrote:
> On Sat, 10 Jan 2009 20:48:21 -0800, Mensanator wrote:
> > Damn! I didn't know you could do that! And if I saw it in a program
> > listing, such would never occur to me. I was going to suggest the stupid
> > way:
> >>>> ga = ['four score and seven years ago ', \
> > � � � � � 'our fathers brought forth ', \
> > � � � � � 'on this continent a new nation ', \
> > � � � � � 'conceived in liberty and dedicated ', \
> > � � � � � 'to the proposition that all men ', \
> > � � � � � 'are created equal']
> What are all those line continuation characters ('\') for? �You are aware
> that they are unnecessary here?
Actually, I wasn't aware of that. A quick review shows
why. In the old manuals, implicit line continuation
was in a seperate chapter (2.1.6) from implicit (2.1.5)
so if you didn't read past 2.1.5 you would have missed it.
The 2.6 manual is much better in this regard as it is
now difficult to miss.
Thanks for pointing that out as lists are just about
the only place I use line continuation.
> � � � � Marc 'BlackJack' Rintsch
More information about the Python-list