【发布时间】:2012-03-14 12:22:36
【问题描述】:
我有两个班级:
class Base(object):
def __init__(self):
object.__init__(self)
def print_methods(self):
print self.__dict__
class Child(Base):
def __init__(self):
Base.__init__(self)
def another_method(self):
pass
现在我可以在Child 实例中调用print_method,并期待看到another_method。但是失败了。
【问题讨论】:
标签: python inheritance