[Python-Dev] On decorators implementation

Paolino paolo_veronelli at libero.it
Sun Aug 21 11:35:37 CEST 2005


I noticed (via using them) that decorations are applied to methods
before  they become methods.

This choice flattens down the implementation to no differentiating
methods from functions.



1)
I have to apply euristics on the wrapped function type when I use the
function as an index key.

         if type(observed) is types.MethodType:
           observed=observed.im_func

things like this are inside my decorators.

2)
The behavior of decorations are not definable.
I imagine that a method implementation of them inside the type metaclass
could be better specified by people.
This probably ends up in metamethods or something I can't grasp


Thanks

Paolino





More information about the Python-Dev mailing list