这里有两个错误:
super()
仅适用于新型类;使用object
的基类frame
,使之使用新型语义。您仍然需要使用正确的参数来调用覆盖的方法。转
image
接到__init__
通话中。
因此正确的代码将是:
class frame(object): def __init__(self, image): self.image = imageclass Eye(frame): def __init__(self, image): super(Eye, self).__init__(image) self.some_other_defined_stuff()



