Suggestions to triple quoted strings proposal

Bob Ippolito bob at redivi.com
Wed Dec 13 03:31:36 PST 2006


On 12/13/06, zwetan <zwetan at gmail.com> wrote:
> Hello all,
> here my two cents from a user point of view
>
> - """, why use triple we don't even have double ?
>   I would prefer some before-quote-parameter
>   as in C# using @"some text here"
>   (anyother parameter than @ is fine)
>
> - I like TQS because it allow to write multiline
>   without juggling with string concatenation to keep it readable
>
>   """

Double quotes would probably be syntactically ambiguous. They look
exactly like an empty string token...

Even if you wormed around that, one of the most common use cases for
triple quoted strings (in Python) is to facilitate documentation and
doctests. Triple quotes can represent any syntactically valid code
without using escapes (except of course, another set of triple
quotes). If it were double quotes, empty string literals would have to
be escaped (or '' would have to be used).

Decorating the quote with some sigil doesn't make multi-line easier,
nor does it get you around the escaping problem. Totally different use
case with no feature overlap.

-bob



More information about the Es4-discuss mailing list