__metaclass__ and __author__ are already decorators

Paolo Veronelli paolo.veronelli at yahoo.it
Sat Aug 21 13:07:11 EDT 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?

You are right ,if some __xxx__ (only __metaclass__ for now?) class 
attributes have deep meanings (not only a syntactical 
one(__lt__,__getitem__,....)) ,and many people suggest not to use them 
(probably there is something about a non pythonicity  of __metaclass__ 
in this behaviour) then it would be very nice to match this deepness 
against the decorator one ,at least using @
before class definitions if it's the case....


	Thanks for pointing out another unpythonicity. Paolino







More information about the Python-list mailing list