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

Bengt Richter bokr at oz.net
Wed Mar 13 16:32:01 EST 2002


On 13 Mar 2002 10:20:19 -0500, Christopher Barber <cbarber at curl.com> wrote:

>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.
>
And for fast skips across the source by just a seek, if encoding is fixed.

>There are corresponding tagged multi-line comments as well.
>
I like the symmetry. And the count idea, which I've seen in other forms,
but not like that. I'll have to look at the multi-line format. Thanks.

Regards,
Bengt Richter




More information about the Python-list mailing list