[Python-Dev] Class decorators

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Mar 29 04:55:32 CEST 2006


Phillip J. Eby wrote:

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

> 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.

I just looked at that discussion, and I didn't see any
argument to refute the thesis that if decorators-on-top
is good enough for functions, it should be good enough
for classes.

In fact it seems to have been written before the on-top
decorator syntax existed, so there's no discussion of
the issue at all.

Seems to me that, since we now already have @-decorators
for functions, a *very* good reason will be needed for
requiring a completely different syntax to get exactly
the same effect for classes.

--
Greg


More information about the Python-Dev mailing list