hi all, i've got a problem with a python class, that i'm deriving from two classes. one of the base classes is a class from pyqt, the other one is a wrapped boost.python class. now, when deriving my class from these two classes, i'm getting the message: TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases any idea, how to solve the metaclass conflict? my boost.python class has the structure: class_<my_wrapper, boost::noncopyable>("my_class") .def("my_fun", &my_wrapper::my_fun); thanks ... tim -- tim@klingt.org ICQ: 96771783 http://tim.klingt.org Nothing exists until or unless it is observed. An artist is making something exist by observing it. And his hope for other people is that they will also make it exist by observing it. I call it 'creative observation.' Creative viewing. William S. Burroughs
Tim Blechmann wrote:
hi all,
i've got a problem with a python class, that i'm deriving from two classes. one of the base classes is a class from pyqt, the other one is a wrapped boost.python class.
now, when deriving my class from these two classes, i'm getting the message: TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
any idea, how to solve the metaclass conflict? my boost.python class has the structure: class_<my_wrapper, boost::noncopyable>("my_class") .def("my_fun", &my_wrapper::my_fun);
The problem you are facing is that there are certain constraints on the metaclasses of your (multiple) base classes: http://www.python.org/download/releases/2.2/descrintro/#metaclasses I don't know pyqt, and I'm not sure you get access to boost.python's own metaclass. (David ?) You may need to derive a new metaclass from boost.python's one as well as the pyqt metaclass. HTH, Stefan -- ...ich hab' noch einen Koffer in Berlin...
hi stefan ...
now, when deriving my class from these two classes, i'm getting the message: TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
any idea, how to solve the metaclass conflict? my boost.python class has the structure: class_<my_wrapper, boost::noncopyable>("my_class") .def("my_fun", &my_wrapper::my_fun);
The problem you are facing is that there are certain constraints on the metaclasses of your (multiple) base classes:
http://www.python.org/download/releases/2.2/descrintro/#metaclasses
I don't know pyqt, and I'm not sure you get access to boost.python's own metaclass. (David ?) You may need to derive a new metaclass from boost.python's one as well as the pyqt metaclass.
i see ... in the meanwhile i've been trying to use the metaclass conflict resolver found at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/204197. however with the result of giving me a TypeError: multiple bases have instance lay-out conflict i would prefer to find a clean solution for this, avoiding the multiple inheritance would add an additional indirection in my code, that i'd like to avoid ... thanks ... tim -- tim@klingt.org ICQ: 96771783 http://tim.klingt.org Your mind will answer most questions if you learn to relax and wait for the answer. William S. Burroughs
Am Freitag, 02. März 2007 00:54 schrieb Tim Blechmann:
i would prefer to find a clean solution for this, avoiding the multiple inheritance would add an additional indirection in my code, that i'd like to avoid ...
Yes, but I can hardly imagine how a SIP/BPL mixture class should behave (think of memory management etc.) - I am quite sure that this simply won't work! -- Ciao, / / /--/ / / ANS
participants (3)
-
Hans Meine -
Stefan Seefeld -
Tim Blechmann