This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients Martin.Teichmann, eric.snow
Date 2014-02-06.04:47:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391662065.39.0.239489855447.issue20518@psf.upfronthosting.co.za>
In-reply-to
Content
So to restate, where some class Spam inherits from multiple classes and at least one was written in C, Spam.__base__ may have an unexpected value.

> So, to conclude: it is sometimes not possible to use python
> cooperative multiple inheritance if C base classes are involved. This
> is a bummer.

Be careful not to muddy the waters here by obscuring the problem you are describing (regarding __base__) with the challenges of making multiple inheritance work.  Multiple inheritance with classes that don't cooperate in your hierarchy is tricky, but solveable and is simply the nature of the beast.  To move this issue forward I recommend simply focusing on how __base__ (and its use) could be improved.

I think part of the problem is that the metaclass of PyQt4 uses the __base__ class attribute instead of the MRO...

<aside>
Cooperative multiple inheritance is all about the classes involved cooperating.  You already indicated that the QT classes do not cooperate.  To work around this you could wrap QT objects with proxies that *do* cooperate in your multiple inheritance scheme.  Alternately you could fiddle around in __init__ to make it work.  Raymond Hettinger had a great talk on this topic at Pycon 2012 (or was it 2013) that would be worth checking out.  I remember him discussing strategies for fitting uncooperative classes into a multiple inheritance hierarchy.
</aside>
History
Date User Action Args
2014-02-06 04:47:45eric.snowsetrecipients: + eric.snow, Martin.Teichmann
2014-02-06 04:47:45eric.snowsetmessageid: <1391662065.39.0.239489855447.issue20518@psf.upfronthosting.co.za>
2014-02-06 04:47:45eric.snowlinkissue20518 messages
2014-02-06 04:47:44eric.snowcreate