metaclass : parse all class once before doing anything else ?

Laurent Rahuel lrahuel.notgood at voila.fr
Fri Jul 28 10:07:17 EDT 2006


Hi,

I have a much to smart problem for my brain.

Here is the deal :

I got a metaclass named Foo

Then I got two others classes:

class Bar(Foo):
        pass

class Baz(Foo):
        pass

I know how to add some attrs, methods to Bar and Baz when the module is
loaded but I need to do something more :

Before adding anything to these classes, 
1 - I need to parse all defined Foo classes
2 - "sort" them 
3 - parse this sorted list to add attrs and methods.

This seems to be really to clever for me ;-(

Any idea ?

Regards,

Laurent.



More information about the Python-list mailing list