Код: Выделить всё
class Y:
def __init__(self):
print("Y initialized")
class X:
def __init__(self):
print("X initialized")
class B(X):
def __init__(self):
super().__init__()
print("B initialized")
class C(Y):
def __init__(self):
super().__init__()
print("C initialized")
class D(B, C):
def __init__(self):
super().__init__()
print("D initialized")
print(D.mro())
obj = D()
Код: Выделить всё
[, , , , , ]
X initialized
B initialized
D initialized
Как выполнить C.__init__() и Y.__init__() ?
Подробнее здесь: https://stackoverflow.com/questions/792 ... le-inherit