[Python-3000] Set literal

Guido van Rossum guido at python.org
Fri Jan 25 19:08:29 CET 2008


On Jan 25, 2008 10:01 AM, Leif Walsh <adlaiff6 at gmail.com> wrote:
> On Jan 25, 2008 12:37 PM, Christian Heimes <lists at cheimes.de> wrote:
> > The pipe char is ambiguous because is no direction. It was suggested and
> > rejected last year.
>
> Out of almost-pure devil's advocacy, has <> been considered?  My first
> instinct is that it would be ambiguous with less-than/greater-than,
> but if someone can convince me otherwise, might it work?  After all,
> it's the only other balanced pair of punctuation I see on my keyboard.

No, there are too many syntactic situations where this would make the
grammar ambiguous or tortuous. We don't want to move beyond LL(1).
(Apart from parsing indentation and nested parentheses, of course --
which actually reminds me or another issue with using <> as brackets:
the lexer can't know whether a particular < or > is used as a bracket
or not, so it can't keep track of nesting like it does for (), [] and
{}. So <> would always remain a second-class citizen.)

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list