[Python-Dev] Re: decorators and 2.4
Jewett, Jim J
jim.jewett at eds.com
Mon Jun 28 12:28:04 EDT 2004
> Is it the name you dislike? Or the idea of simply
> invoking decorating functions directly?
If decorate is a callable class rather than a function,
it can be subclassed for common idioms.
The question is whether or not this is a good idea. Any
specific use will be more clear with a usage-specific
name, but the construct as a whole may be muddied if nothing
ties these names together. For instance, it classmethod
were subclassed from decorate (but used current usage when
it got an argument), you could write
But you would also see things like
dec1() # No good way to chain decorators.
Personally, I want decorators tied together with a word (such
as "decorate" or "using"), but I admit that list brackets +
line-break *might* be enough.
More information about the Python-Dev