Multi Heritage with slots

Alexandre Badez alexandre.badez at gmail.com
Wed Sep 5 05:01:56 EDT 2007


Hye,

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']
    pass

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

class crash(foo, foo2):
    pass

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