Calling super class method in multiple inheritance
问题 I have the following code: class A: pass class B(A): def foo(self, a): if a: return 'B' return super(B, self).foo(a) class C: def foo(self, a): return 'C' class D(B, C): def foo(self, a): return super().foo(a) d = D() print(d.foo(0)) When I call d.foo(0) based on MRO it first calls the foo method of B class and inside that, if the condition is wrong and it will return super(B, self).foo(0) but class A has no foo method and I expect this error: AttributeError: 'super' object has no attribute