Description
Consider the following code (see attachment for full working code):
class A: def __init__(self): super().__init__() class B(QObject, A): def __init__(self, parent=None): super().__init__(parent)
Any class after the QObject in the MRO can not make use of the QObject inside their __init__(): None of the QObject’s methods work, self can not be used as parent for another QObject and str(self)/repr(self) fail.
Looking at the bindings code generated by Shiboken, this is because Shiboken::callInheritedInit() – which implements super() – is called before before the underlying C++ QObject is created. SIP does the opposite. That is, in PyQt one can use the QObject in __init__() of classes which follow the QObject in the MRO.