[Python-Dev] Re: PEP 318: Decorators last before colon (original) (raw)
David Eppstein eppstein at ics.uci.edu
Mon Apr 5 19:24:14 EDT 2004
- Previous message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In article <200404052209.i35M9m606023 at guido.python.org>, Guido van Rossum <guido at python.org> wrote:
> presumably the parser could handle this syntax if "as" were a keyword.
Not really. The parser is really dumb, it han only handle one alternative starting with a particular token at any point. Since '['_ _can already start an expression and an expression is a valid_ _statement, anything else also starting with '[', even if it isn't a_ _valid expression, cannot be accepted. You may be thinking of Yacc,_ _which has much more liberal rules._ _--Guido van Rossum (home page: http://www.python.org/~guido/)
Ok, then how about def ... ?
'<' can't start an expression or statement currently, can it?
-- David Eppstein http://www.ics.uci.edu/~eppstein/ Univ. of California, Irvine, School of Information & Computer Science
- Previous message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]