我正在尝试理解Python中的类继承,在下面的继承中进行了创建:
问题:当我继承类B并调用方法A时,它会打印“我是方法B”.. 那么它不会调用类A的methodA吗?
class A(object):
def methodA(self):
print 'Im method A'
class B(A):
def methodA(self):
print 'Im method B'
class C(A):
def methodA(self):
print 'Im method C'
class D(B,C):
def methodA(self):
print 'Im method D'
def main():
x = D()
x.methodA()