[Python-Dev] Dropping decorator syntax for 2.4?

Skip Montanaro skip at pobox.com
Fri Jun 4 10:22:22 EDT 2004


    Jeremy> Not that it's practical for 2.4, but I think it wouldn't be hard
    Jeremy> to post-process the existing AST to recognize decorators written
    Jeremy> like this.

    Jeremy> You'd like for adjacent statements of the form:
    Jeremy>     Expr(List())
    Jeremy>     FunctionDef()
    Jeremy> and replace them with a single
    Jeremy>     FunctionDef()

Yes, but only if it appears at the top level of a module.

    Jeremy> Or do we need to catch Expr(ListComp()) too?  PEP 318 doesn't
    Jeremy> mention semantics anywhere, so it doesn't say what is allowed
    Jeremy> inside the square brackets.

I think you probably have to look at Michael Hudson's patch for semantics at
the moment.  The original PEP 318 was purely about syntax.  I made some
changes and Jim Jewett sent me some more changes which I still have sitting
in my mailbox.  I'll see if I can dig them out over the weekend and merge
them in.

Skip



More information about the Python-Dev mailing list