Is this a bug?

Alex Martelli aleaxit at yahoo.com
Sun May 13 04:02:05 EDT 2001


"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...?


Alex






More information about the Python-list mailing list