AOP and metaclasses

Santiago Aguiar santi at netlabs.com.uy
Fri Feb 20 09:55:45 EST 2004


Im trying to use AOP techniques on python but, even if I understand
the idea behind metaclasses, I cant find a way to use AOP in a dynamic
way.

What im trying to do is to weave an aspect to a class at runtime, but
i don't want to include any special code or definition in the class
itself. Also, i want to do
it just for some particular classes. Is there any way to do this? 

I know its possible to apply an aspect to all the classes by
redefining __metaclass__, and that I can do the same with a single
class by assigning to __metaclass__ inside the class definition.
However, I want to avoid the last step, so i can apply the aspect to
any class.

thanks!!

saludos! santiago.



More information about the Python-list mailing list