Title: @decorators, including classes
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
Status: closed Resolution: postponed
Dependencies: Superseder:
Assigned To: Nosy List: jackdied
Priority: normal Keywords: patch

Created on 2004-08-12 14:53 by jackdied, last changed 2005-01-04 17:59 by jackdied. This issue is now closed.

File name Uploaded Description Edit
class_decorators.diff jackdied, 2004-08-12 14:53 @ decorator patch, now with classes
Messages (2)
msg46685 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2004-08-12 14:53
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,,, 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).
msg46686 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2005-01-04 17:59
Logged In: YES 

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).
Date User Action Args
2004-08-12 14:53:14jackdiedcreate