class Base1:
def method(self,aa):
return aa+'ii'
class Base2:
def method(self,bb):
return bb+'pp'
class MyClass(Base1,Base2):
pass
a=MyClass()
print a.method('ggg')
print a.method('hhh')
C:Python27python.exe C:/Users/TLCB/PycharmProjects/untitled/mycompany/aaa/a7.py
gggii
hhhii
当a.method 被调用时,解释程序将查找MyClass中的方法,然后在Base1中查找,
最后再Base2中查找
现在, 在两个基类之上引入一个BaseBase类(Base1和Base2都从其继承)