Alternative decorator syntax decision

Paul Morrow pm_mon at
Sat Aug 21 01:44:50 CEST 2004

Note: This is *not* about implicit method typing... :-)

Although I haven't seen it discussed anywhere, we already have a 
decorator syntax (of sorts) that we use to annotate functions and 
classes.  The " __var__ = " business.  Have we decided that it is 
woefully insufficient?  I know that there is a preference for the 
decorators to appear outside of the function def, but putting that 
aside, this 'style' of decorating already has a precendent in python, so 
it is probably as pythonic as you can get...

     class Foo:
         __metaclass__ = M
         __automethods__ = True
         __author__ = 'Paul Morrow'
         __version__ = '0.1'

     def baz(a,b,c):
         __synchronized__ = True
         __accepts__ = (int,int,int)
         __returns__ = int
         __author__ = 'Fred Flintstone'

	return a + b + c

What is the burning desire to abandon this style?


More information about the Python-list mailing list