class Pepega:
def __init__(self) -> None:
print("this pepega()")
class Smart(Pepega):
def __init__(self):
print("__init__Smart")
super().__init__()
class Monkey(Pepega):
def __init__(self):
print("Monkey()")
super().__init__()
class SmartMonk(Monkey, Smart):
def __init__(self):
print("__init__SmartMonk")
super().__init__()
smrtM = SmartMonk()
Python 使用 MRO - 一种解决菱形继承中顺序的方法,您可以在这里阅读https://tirinox.ru/mro-python/