Multiple Inheritance __slots__ problem

Nitin Shukla nitinshukla at infotech.stph.net
Fri Dec 24 07:07:22 EST 2004


Hello,

Can anyone tell why am I getting this error and how to work around this
problem.

>>> class Klass(object):
... 	__slots__ = ( 'x' )
...
>>> class Klass1(object):
... 	__slots__ = ( 'y' )
...
>>> class Klass(Klass, Klass1):
... 	__slots__ = ( 'z' )
...
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: multiple bases have instance lay-out conflict

I need to define slots in these classes and also need to inherit them in
Derived class.

Nitin





More information about the Python-list mailing list