multiline snippets with triple quotes

Christoph Zwerschke cito at online.de
Fri Aug 13 00:50:05 EDT 2004


> IIRC, sequential strings with only whitespace in between them are
> automatically concatenated.

Yes, but you have to add either brackets around everything or backslashes at
the line ends, otherwise the lines are not kept together.

> This does have the disadvantage of requiring explicit newlines, however.

Yes, plus you need to escape the double quotes.

These three disadvantages are why I wanted to use triple quotes.

Chris





More information about the Python-list mailing list