line continuations with backslash

Tim Peters tim.one at home.com
Sat Aug 25 21:48:33 EDT 2001


[Tim]
> 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.

you-spent-more-time-writing-about-it-than-your-computer-will-save-over-
    the-rest-of-our-lives<wink>-ly y'rs  - tim





More information about the Python-list mailing list