[Patches] [ python-Patches-1007991 ] @decorators, including classes

SourceForge.net noreply at sourceforge.net
Thu Aug 12 19:18:42 CEST 2004


Patches item #1007991, was opened at 2004-08-12 10:53
Message generated for change (Settings changed) made by jackdied
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1007991&group_id=5470

>Category: Parser/Compiler
>Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Jack Diederich (jackdied)
Assigned to: Nobody/Anonymous (nobody)
Summary: @decorators, including classes

Initial Comment:
This patch is modeled on the original @ patch #979728

Functions are now ignorant of their decorated status. 
The regular function & class functions are called from
the com_decorated_thing() function which applies the
decorators.  the new Grammar production is 
decorated_thing: decorators (funcdef|classdef)

passes all tests (including augmented test_decorators)

com_decorated_thing() in compile.c uses a VAR_LOAD to
get the class/function to decorate.  There is probably
an easier way to do this.

I updated the compiler package (ast.txt, pycodegen.py,
symbols.py, transformer.py) and it passes all tests but
I'm not sure it is correct (the tests pass as long as
they don't throw an exception).


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1007991&group_id=5470


More information about the Patches mailing list