顺序,初始化从右往左
class Human(object):
...
class Father(Human):
def __init__(self):
super().__init__()
self.test1 = "父亲"
class Mother(Human):
def __init__(self):
super().__init__()
self.test1 = "母亲"
class Child(Father, Mother):
def __init__(self):
super().__init__()
print(self.test1)
c = Child()
output
父亲
标签:__,.__,python,self,继承,init,Human,class
From: https://www.cnblogs.com/code3/p/17354850.html