class C:
def init(self):
print(‘enter C’)
print(‘leave C’)
class A:
def init(self):
print(“enter A”)
print(“leave A”)
class B(A): # A –> C
def init(self):
print(“enter B”)
super(B, self).init()
print(“leave B”)if name == ‘main‘:
b = B()
python the method of super function
最新推荐文章于 2019-01-03 16:38:42 发布