[Python-3000] Set literal

Guido van Rossum guido at python.org
Fri Jan 25 19:23:20 CET 2008

On Jan 25, 2008 10:15 AM, nathan binkert <nate at binkert.org> wrote:
> > 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.)
> What about a single character prefix like we have with r'' and u''?
> We could have f{} and s{}.
> I'm not particularly enamored by the idea, but the parser should be
> able to handle it, no?

It's not the same -- r"..." is a single token to the lexer, but r{...}
is multiple tokens. It would also rule out a possible future syntactic
extension (present in some other languages) where, in analogy of
foo(...) and foo[...] you can also write foo{...}.

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

More information about the Python-3000 mailing list