python多重继承

#多重继承

class Base(object):
def __init__(self):
print("Base init")

class Medium1(Base):
def __init__(self):
super(Medium1,self).__init__()
print("Medium1 init")

class Medium2(Base):
def __init__(self):
super(Medium2,self).__init__()
print("Medium2 init")


class Leaf(Medium1,Medium2):
def __init__(self):
super(Leaf,self).__init__()
print("Leaf init")


leaf=Leaf()



原文地址:https://www.cnblogs.com/wiki918/p/9712714.html