This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: @decorators, including classes
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
process
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 2022-04-11 14:56 by admin. This issue is now closed.

Files
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, 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).
msg46686 - (view) Author: Jack Diederich (jackdied) * (Python committer) Date: 2005-01-04 17:59
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).
History
Date User Action Args
2022-04-11 14:56:06adminsetgithub: 40747
2004-08-12 14:53:14jackdiedcreate