On Feb 28, 10:50 pm, [EMAIL PROTECTED] wrote:
> I encountered an oddity in attempting to use a metaclass to perform mix-in
> inheritance for classes. I've attached a small demonstration file. Have I
> misunderstood the bases argument for type.__init__ or should this be submitted
> as a bug?
After a quick look at your example:
* you are mixing classic classes (abase) and new-style classes (A and
B), which often creates problems.
* type.__init__ does not set the base classes, type.__new__ does
this. What you want to achieve could be done with:
class meta3(type):
def __new__(cls, name, bases, dict):
bases += (abase,)
return type.__new__(cls, name, bases, dict)
HTH
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list