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

SourceForge.net noreply at sourceforge.net
Tue Jan 4 18:59:49 CET 2005


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: Closed
>Resolution: Postponed
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).


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

>Comment By: Jack Diederich (jackdied)
Date: 2005-01-04 12:59

Message:
Logged In: YES 
user_id=591932

Closed the patch and marked it "postponed"
I'd like to see class decorators in 2.5, I'll submit another
patch at a later time (when hopefully more people are
clamoring for it).


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

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