Decorator syntax (was Re: PEP 318 - PyFIT comments)

Michael Ekstrand python at elehack.net
Wed Aug 4 15:33:05 EDT 2004


On Wednesday 04 August 2004 14:11, Ville Vainio wrote:
> Yes, it should work. It's also a terrible waste of @ punctuation,
> which should IMO be reserved for some more worthwhile purpose.

I'd concur with that... I saw the decorator syntax and thought "what is 
this thing? and why is it in Python?"

When I read about decorators in the What's New guide, the first syntax 
that jumped to my mind was:

def(staticmethod) somemethod(self, args):
    some code

This was before reading the PEP or seeing any other recommendations for 
syntax (except the nested-block syntax mentioned in another thread, 
which I don't like either; it seems to not fit the nature of 
decorations very well).

-Michael



More information about the Python-list mailing list