You yourself answered the question - the second object
superfluous. Class C has two bases: an object and StrMixin. However, the StrMixin base is also an object, so it is confused as to which object it should solve first. MRO evaluates it as (C, STRMixin, object, object), which has duplicate objects. In this particular case, it seems obvious what the solution should be, but add a few more classes, and the MRO may become less clear. For instance.
class A(object): pass class B(object, A): pass class C(object, A): pass class D(object, B, C): pass class E(object, A, D): pass
What is MRO for E? Be that as it may, its really complicated, has duplicates, and possibly several cycles.
The MRO is explained pretty well here , and your particular case is seen about two-thirds down the page, the first example in the βBad permission ordersβ section.
source share