Is this a bug?

Costas Menico costas at meezon.com
Sun May 13 09:49:22 EDT 2001


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

>"Costas Menico" <costas at meezon.com> wrote in message
>news:3afda52c.5731036 at News.CIS.DFN.DE...
>    ...
>> 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
>
>So how would we distinguish:
>
>x=''    # just the empty string
>
>from
>
>y=''     # this is inside string y, mind you...  ''
>
>
>...?  Aren't we back again to unlimited amount of parser lookahead?
>Or isn't syntax y allowed and by what other black-magic ad-hoc rule?
>
>
>> We already have one quote and three quotes. May as well use two
>> quotes. Actually the r should also allow selection of the delimiters.
>
>We DO use 'two quotes' -- for the empty string, for example.  So
>would the now-very-simple task of specifying an empty string
>literal become more complicated in your dream world, or...?
>

I guess there is no perfect solution. We can do something similar to
what ASP does. <% %>. Just dont include %> inside your string. But I
am sure there are more important upgrades to Python than this.

Costas




More information about the Python-list mailing list