I have a question regarding the multi-level inheritance in Python. Following classes are in my script.
class A():
def __init__(self, x, y, z):
self.x = x
class B():
def __init__(self, x, y, z):
self.x = x
class C(A):
def __init__(self, x):
super.__init__(x)
self.x = x
class D(B,C):
def __init__(self, x):
super.__init__(x)
self.x = x
I'm not sure if my question will be understandable but I will try to explain.
- If class C inherits from class A the form in class C will be a rectangle.
- If class C inherits from class B the form in class C will be a circle.
- But if class D inherits class B (Circle class) first and then class C(A) it will be a circle form although class C still inherits from class A (in the script). The other way around D(C,B) it will be a rectangle form (looks like because C(A) will be initialized first)
Why does the multi-inheritance in class D "override" the parent from class C to be a circle instead of a rectangle form?