您可能认为您可以调用由属性调用的基类函数:
class FooBar(Foo): @property def bar(self): # return the same value # as in the base class return Foo.bar(self)
尽管我认为这是最明显的尝试- 它不起作用,因为bar是属性,而不是可调用的。
但是属性只是一个对象,使用getter方法可以找到相应的属性:
class FooBar(Foo): @property def bar(self): # return the same value # as in the base class return Foo.bar.fget(self)



