line continuations with backslash

Tim Peters at
Sun Aug 26 03:48:33 CEST 2001

> You don't need the "+" signs there; as in C, adjacent string
> literals are catenated at compile-time.

[Skip Montanaro]
> so why not this then:
>     x = long("123"
>              "456"
>              "789")
> which saves all the splitting and joining and is (nearly) as readable?

Because it's not as readable, or as easy to edit.  The cost of splitting and
joining on one-shot initialization code is insignificant, most likely too
small to measure.

    the-rest-of-our-lives<wink>-ly y'rs  - tim

More information about the Python-list mailing list