Is this a bug?

Costas Menico costas at meezon.com
Sat May 12 17:21:02 EDT 2001


"Alex Martelli" <aleaxit at yahoo.com> wrote:

>"Costas Menico" <costas at meezon.com> wrote in message
>news:3afd33ac.3862765 at News.CIS.DFN.DE...
>    [snip]
>> To me the r'' syntax is inconsistent and works 99% of the time only.
>> I don't want to check if there is a BS at the end of a string and do
>> some magic to fix it. The r'' should be doing that for me.
>
>How would your dream r-architecture magically let you write
>    x=r'ba\'    # hypothetical rawstring with a trailing BS
>AND
>    y=r'ba\'    # hypothetical rawstring with a trailing BS'
>where y is meant to contain a backslash-quote combination
>and then the whitespace, the hash, etc?
>

Actually my dream r-architecture is quite simple. Take anything that
starts and ends with two quotes to be the literal sring. 

x=''abcdef'''  -> abcdef'
x=''abc'xyz''  -> abc'xyz
x=''abc\'xyz'' -> abc\'xyz

We already have one quote and three quotes. May as well use two
quotes. Actually the r should also allow selection of the delimiters. 

Costas







More information about the Python-list mailing list