compromise? keywords for static/class, move decorators to top of function

Hallvard B Furuseth h.b.furuseth at usit.uio.no
Mon Aug 9 16:33:22 CEST 2004


Larry Bates wrote:

> Couldn't we use a dictionary construct like the one
> used in classes to hold the dictionaries attributes.
> I'm talking about __dict__ construct.
> 
> def getratio(arg1, arg2):
>     __decorators__['getratio']={} # Maybe this is automatic?
>     (...)
> I'm certain that I'm missing something very important,

Yes:  Decorators should be set before the function is called.  Your
code is executed after function is called.  Or if you define some
magic to avoid that, it still looks like it is.

-- 
Hallvard



More information about the Python-list mailing list