I recently had a problem understanding the code below:
class A(object):
def __init__(self):
print("go A go!")
class B(A):
def __init__(self):
super(B, self).__init__()
print("go B go!")
class C(A):
def __init__(self):
super(C, self).__init__()
print("go C go!")
class D(B,C):
def __init__(self):
super(D, self).__init__()
print("go D go!")
d = D()
The result I got is:
go A go!
go C go!
go B go!
go D go!
I understand the use of super() in simple multiple-inheritance but I really don't know how it got this result.