python继承 super()
写这篇博文,始于以下问题的探究: 1 #coding:utf-8 2 class A(object): 3 def __init__(self): 4 print 'enter A' 5 print 'leave A' 6 class B(object): 7 def __init__(self): 8 print 'enter B' 9 print 'leave B' 10 11 class C(A): 12 def __init__(self): 13 print 'enter C' 14 super(C, self).__init__() 15 print 'leave C' 16 17 class D(A): 18 def __init__(self): 19 print 'enter D' 20 super(D, self).__init__() 21 print 'leave D' 22 23 class E(B, C): 24 def __init__(self): 25 print 'enter E' 26 B.__init__(self) 27 C.__init__(self) 28 print 'leave E' 29 30 class F(E, D): 31 def __init__(self): 32 print 'enter F' 33 E.__init_