RFC PEP candidate: q'<delim>'quoted<delim> ?

Christopher Barber cbarber at curl.com
Wed Mar 13 10:20:19 EST 2002


bokr at oz.net (Bengt Richter) writes:

> you wouldn't choose the same delimiter ;-) I.e., the main point of
> using an (almost) arbitrary sequence of characters as a delimiter is
> so you'll always have a choice of new delimiters if you need them to
> wrap around text containing old ones.

For comparison, in the Curl language, there is a concept of tagged verbatim
strings, which look like:

   |<tag>"...stuff..."<tag>|

where <tag> can be any identifier (or nothing).

If the tag is an integer, it specifies the number of characters in the string:

  |3"foo"3|

This is useful when you are generating code containing arbitrary string
literals.

There are corresponding tagged multi-line comments as well.

- Christopher




More information about the Python-list mailing list