I'm new to concept of super.I'm unable to understand the call stack made by m method of each class in this code
class A:
def m(self):
print("m of A called")
print("OUT OF A")
class B(A):
def m(self):
print("m of B called")
super().m()
print("OUT OF B")
class C(A):
def m(self):
print("m of C called")
super().m()
print("OUT OF C")
class D(B,C):
def m(self):
print("m of D called")
super().m()
print("OUT OF D")
x = D()
x.m()
Output of following is:
m of D called
m of B called
m of C called
m of A called
OUT OF A
OUT OF C
OUT OF B
OUT OF D
How is super from D calling B.() and C.() which calls A.m() only once