With the code below
class A(object):
def TestMRO(self):
s = super()
print(f'A: s = {s}')
return super().TestMRO()
class B(object):
def TestMRO(self):
print('B')
return 1
class C(object):
def TestMRO(self): # abstract
print('C')
raise NotImplementedError
class D(A, B, C):
pass
class E(D):
pass
e = E()
e.TestMRO()
, it returns:
A: s = <super: <class 'A'>, <E object>>
B
I'm confused, why super()
from class A triggered a method in class B?