[PyQt] sip bug?

Phil Thompson phil at riverbankcomputing.com
Sat Aug 15 16:42:40 BST 2009


On Sat, 15 Aug 2009 12:00:27 +0200, Marcos Dione <mdione at grulic.org.ar>
wrote:
> I'm really not sure if this is a bug or not. is related to the
inheritance
> from QObject and dbus.service.Object. I have this code:
> 
> MetaDBusObject= type (dbus.service.Object)
> MetaQObject= type (QObject)
> 
> class MetaObject (MetaQObject, MetaDBusObject):
>     """Dummy metaclass that allows us to inherit from both QObject and
>     d.s.Object"""
>     def __init__(cls, name, bases, dct):
>         MetaDBusObject.__init__ (cls, name, bases, dct)
>         MetaQObject.__init__ (cls, name, bases, dct)
> 
>     This works fine. but if I reverse the order of the inheritance in the
> MetaObject class definition:
> 
> class MetaObject (MetaDBusObject, MetaQObject):
>     [...]
> 
>     I get this error:
> 
> python: /tmp/buildd/sip4-qt3-4.8.1/siplib/siplib.c:7213:
> sipWrapperType_init: Assertion `self->type->u.td_py_type == ((void *)0)'
> failed.
> Aborted

I really don't see how the technique of sub-classing from both meta-types
can work in all cases given that only one thing can implement __new__.

Phil


More information about the PyQt mailing list