__metaclass__ and __author__ are already decorators

Leif K-Brooks eurleif at ecritters.biz
Sat Aug 21 20:02:43 CEST 2004


Paul Morrow wrote:
> Thinking about decorators, and looking at what we are already doing in 
> our Python code, it seems that __metaclass__, __author__, __version__, 
> etc. are all examples of decorators.  So we already have a decorator 
> syntax.  What is the compelling reason to invent a new one?  And if we 
> do, what's to become of the old one?
> <snip>

I've thought about something along the lines of your suggestion before, 
but it doesn't seem very Pythonic to assign special meaning to function 
variables with special names to me. It's essentially a new syntax, but 
disguised as an old syntax with an entirely different meaning.



More information about the Python-list mailing list