<div dir="ltr">The PyQt5 cooperative multi-inheritance is implemented for __init__, but not for __new__.  It looks like one or all of PyQt5.QtCore.QObject, sip.wrapper, and.or sip.simplewrapper don't cooperate by invoking super().__new__.<div><br></div><div>Can this be addressed in PyQt, or is there a fundamental reason that calling super().__new__ is omitted?</div><div><br></div><div>Below is code that demonstrates the problem. You can see that __init__ is properly invoked via super()'s MRO chain, but __new__ gets blocked by (at least) one of the three mentioned classes. They all should invoke super().__new__ in order to cooperate properly.<br></div><div><br></div><div>This can be worked around by being careful with ordering of bases as shown (or probably with an adapter class), but it would be nice if PyQt fully supported cooperative multi inheritance here.</div><div><br></div><div>The code:</div><div><br></div><div><div dir="ltr" data-smartmail="gmail_signature">```</div><font face="monospace"><font color="#0000ff">from PyQt5 import QtCore<br><br>class Mixin:<br>    def __new__(cls, *args, **kwargs):<br>        print("Called Mixin.__new__")<br>        self = super().__new__(cls, *args, **kwargs)<br>        return self<br><br>    def __init__(self, age = 0, **kwargs):<br>        print("Called Mixin.__init__")<br>        super().__init__(**kwargs)<br><br>class MyQObject_bad(QtCore.QObject, Mixin): pass<br>class MyQObject_good(Mixin, QtCore.QObject): pass<br><br>print("Showing MyQObject_good example:")<br>good = MyQObject_good()<br><br>print("\nShowing MyQObject_bad example (Mixin.__new__ not called!):")<br>bad = MyQObject_bad()<br><br>print("\nMROs (to show that Mixin.__new__ gets blocked):")<br>sep = "\n - "<br>print(f"Good MRO:{sep}{sep.join(cls.__name__ for cls in MyQObject_good.__mro__)}")<br>print(f"Bad MRO: {sep}{sep.join(cls.__name__ for cls in MyQObject_bad.__mro__)}")</font><br></font><div dir="ltr" data-smartmail="gmail_signature">```<br></div></div><div dir="ltr" data-smartmail="gmail_signature"><br></div><div data-smartmail="gmail_signature">Output of the above script looks like this:</div><div data-smartmail="gmail_signature"><br></div><div data-smartmail="gmail_signature">```</div><font face="monospace"><font color="#674ea7">Showing MyQObject_good example:<br>Called Mixin.__new__<br>Called Mixin.__init__<br><br>Showing MyQObject_bad example (Mixin.__new__ not called!):<br>Called Mixin.__init__<br><br>MROs (to show that Mixin.__new__ gets blocked):<br>Good MRO:<br> - MyQObject_good<br> - Mixin<br> - QObject<br> - wrapper<br> - simplewrapper<br> - object<br>Bad MRO: <br> - MyQObject_bad<br> - QObject<br> - wrapper<br> - simplewrapper<br> - Mixin<br> - object</font><br></font><div data-smartmail="gmail_signature">```<br></div><div data-smartmail="gmail_signature"><br></div></div>