Hot to split string literals that will across two or more lines ?

Ben Finney bignose+hates-spam at benfinney.id.au
Thu Nov 17 23:59:30 EST 2005


Tony Nelson <*firstname*nlsnews at georgea*lastname*.com> wrote:
> While we're at it, I use bracketing instead of line continuation:
> 
>     print ( "a long string, longer than this "
>             "and some more of the string" )

To continue the pedantry: Those are parentheses, not brackets.

Slightly more on-topic, the parentheses make it look like a sequence
to this reader (though, without a comma, not to the Python parser, of
course).

-- 
 \      Q: "I've heard that Linux causes cancer..."  Torvalds: "That's |
  `\       a filthy lie. Besides, it was only in rats and has not been |
_o__)                        reproduced in humans."  -- Linus Torvalds |
Ben Finney



More information about the Python-list mailing list