1, take the initiative to call the other members of the class
method one
class Base (Object): DEF F1 (Self): Print ( ' . 5 functions ' ) class Foo (Object): DEF F1 (Self): Print ( ' . 3 functions ' ) Base.f1 (Self) obj = Foo ( ) obj.f1 () summary: . Base instance method (transfer own self) and inherited nothing to do
Second way
# ########### way: the order of succession according to the class, to find the next one. Class Foo (Object): DEF F1 (Self): Super () F1 (). Print ( ' . 3 functions ' ) class Bar (Object): DEF F1 (Self): Print ( ' . 6 functions ' ) class Info (Foo, Bar): Pass # obj = Foo () # obj.f1 () obj = Info () obj. f1 ()