Class A (object): def test_func (self): print (' From A ') class B (A): Pass # def test_func (self): # print ("From B") class C (A): Pass # def test_func (self): # print ("from C") #多继承, 2.7 and 3.0 is a bit different, 2.7 of the classic class is depth first, 3.0 of the classic class is also the breadth first, 3.0 of the new class is also the breadth first, such as Class D inherits C class and Class B, and C class and Class B inherit Class A # If there is a B c d in the same way, then the order of the call is C,b,a, because we are here Class D (c,b), so the order of the call is C,b, if it is Class D (b,c), then the order of the call is B,cclass D (c,b): Pass # def Test_func ( Self): # print ("from d") D = d () D.test_func () # 1, if there is a Test_func method in Class D, then execute the method # from D#2 of Class D, if there is no test_ in class D FUCN This method, then the first execution of Class C in the Test_func method # from C#3, if Class C does not have test_func this method, then the method of Test_func in class B will be executed # from B#4, if there is no test_ in class B, C Func This method, then the method of Test_func in Class A is executed # from a
Multiple inheritance like Python