【发布时间】:2013-11-28 10:28:25
【问题描述】:
如果您从许多实现了相同方法的类继承,Python 会提供什么行为?
Class A():
def method():
pass
Class B():
def method():
pass
Class C(A,B):
pass
【问题讨论】:
-
您是否尝试过这样做?
-
查找“方法解析顺序”(mro)的概念。
-
这也取决于 Python 版本; Python 2 还是 3?如果是 Python 2,
A()是否继承自object?
标签: python class inheritance multiple-inheritance