Class M just inherits the attributes of class Z twice (redundantly), right, or am I missing something?
, "" , Python , (MRO), , , . , Z .
MRO , :
MRO(X) = (X,object)
MRO(Y) = (Y,object)
MRO(Z) = (Z,object)
MRO(A) = (A,X,Y,object)
MRO(B) = (B,Y,Z,object)
MRO M :
MRO(M) = (M,)+merge((A,X,Y,object),(B,Y,Z,object),(Z,object))
= (M,A,X,B,Y,Z,object)
, , Python , self.__dict__ ). , Python MRO . .
super() - -, , MRO . , :
class B:
def foo():
super().bar()
m = M() m.foo(), - foo() B, super().bar bar Y, , bar Z , , object.
. , :
self.qux = 1425
self.__dict__ .
Z, , : B , Z . , Z - MRO, B .