Re: python strings

Tim Peters (tim@ksr.com)
Tue, 26 Apr 94 16:54:48 -0400

> [jaap]
> ... fail to see the redeeming feature of triple double quotes. Why not
> just use a single double quote for that?

One of the features is the one you gave in the msg preceding this one:
being able to write normal text without embedded explicit escapes. If
"..." were extended to allow multi-line strings, you'd have to backslash
each double quote within the string. But within a triple-quoted string,
embedded single and double quotes in isolation, or even in pairs, need
not be escaped.

A second feature is that runaway strings are very easy to find if they're
introduced by the obnoxious '"""'.

A third feature was the hope that some well-defined amount of leading
whitespace could be stripped from the lines of a multi-line string
automagically. Can't do that for the "..." or '...' form of strings,
because it would change the meaning of some currently-correct programs.
But this last one doesn't appear to apply anymore ('tho it should <wink>).

summarizingly y'rs - tim

Tim Peters tim@ksr.com
not speaking for Kendall Square Research Corp