python-类的继承
print(C.__bases__) #返回父类;不包含祖宗类
继承搜索顺序:
print(A.mro()) 返回类A的搜索顺序
class D: age='d' class B(D): # age='b' pass class C(D): # age='c' pass class A(B,C): # age='a' pass print(A.mro()) 返回类A的搜索顺序
#[<class '__main__.A'>, <class '__main__.B'>, <class '__main__.C'>, <class '__main__.D'>, <class 'object'>]
天子骄龙