Multi Heritage with slots

Alexandre Badez alexandre.badez at
Wed Sep 5 11:01:56 CEST 2007


I'm developing a little app, and I want to make multi heritage.
My problem is that my both parent do have __slots__ define.

So I've got something like:

class foo(object):
    __slots__ = ['a', 'b']

class foo2(object):
    __slots__ = ['c', 'd']

class crash(foo, foo2):

If you write only that in a sample file or in python console (as I
did), python refuse to load the module and report something like:

Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: Error when calling the metaclass bases
    multiple bases have instance lay-out conflict

Do you know why it append? And how could I make this work?

More information about the Python-list mailing list