[Python-Dev] Class decorators

Phillip J. Eby pje at telecommunity.com
Tue Mar 28 20:46:50 CEST 2006


At 10:01 AM 3/28/2006 -0800, Guido van Rossum wrote:
>OK, I'm convinced (mostly by the awful hackery that Phillip so proudly
>exposed :-).

Just as a historical note, here's where you previously rejected the same 
hackery as an argument for supporting class decorators:

http://mail.python.org/pipermail/python-dev/2004-March/043462.html

Ironically, the subsequent discussion following the above message brought 
me around to your point of view.  :)

Or more precisely, the subsequent discussion and examples convinced me that 
putting class decorators on top of the class was bad for readability, vs. 
putting them in the body just after the docstring.  As you said, "the use 
cases are certainly very *different* than those for function/method 
decorators".

So at this point I'd rather see a way to make my hackery go away (or become 
part of the standard library in some fashion) rather than simply mimic 
@decorators for classes.



More information about the Python-Dev mailing list