[Compiler-sig] Help with the AST re decorators

Neil Schemenauer nas at arctrix.com
Sat Apr 2 19:19:54 CEST 2005


On Sat, Apr 02, 2005 at 10:27:10AM -0500, Neal Norwitz wrote:
> I don't have any advice, but have you looked at this patch:
> 
>         http://sourceforge.net/tracker/index.php?func=detail&aid=1167709&group_id=5470&atid=305470

I just looked at it.  The patch works and is simpler than what I was
doing.  It uses this definition:

-       stmt = FunctionDef(identifier name, arguments args, stmt* body)
+       stmt = FunctionDef(identifier name, arguments args, 
+                           stmt* body, expr* decorators)

When transforming the CST to the AST, it creates either a Call or a
Name/Attribute node for each decorator expr.

  Neil


More information about the Compiler-sig mailing list