Decorator syntax

Sean Ross sross at connectmail.carleton.ca
Sat Aug 7 16:39:06 CEST 2004


"Sean Ross" <sross at connectmail.carleton.ca> wrote in message
news:O%4Rc.49731$Vm1.1246946 at news20.bellglobal.com...
> def foo(a, b, c):
>     "foo can decorate itself, from the inside"
>     foo.decorate(abstract, synchronized, classmethod,
>                        accepts=(int,int,int), author='Chris King')
>     ...
>     ...

Actually, nevermind: foo's going to call decorate every time it's called.
Not good. Also it doesn't work with multi|generic method schemes, nor with
really_long_function_or_method_names().






More information about the Python-list mailing list