Strange metaclass behaviour

2006-03-23 Thread Christian Eder
Hi, I think I have discovered a problem in context of metaclasses and multiple inheritance in python 2.4, which I could finally reduce to a simple example: Look at following code: class M_A (type) : def __new__ (meta, name, bases, dict) : print "M.__new__", meta, name, bases

Re: Strange metaclass behaviour

2006-03-23 Thread Christian Eder
Ziga Seilnacht wrote: > I hope that above explanation helps. > Thanks for your support. I now understand what happens here, but I'm not really happy with the situation. Your solution is a nice workaround, but in a quite huge and complex class framework with a lot a custom metaclasses you don't

Re: Strange metaclass behaviour

2006-03-23 Thread Christian Eder
Michele Simionato wrote: > Still, it is an interesting exercise if you are willing to risk the > melting of your brain, > so here is the code ;) I tried your code and it fixes the double execution, but the __new__ is executed in context of M_A instead of M_B which would be the more specific typ