如何访问另一个基数 class 的基数 class 的 属性?

How can I access a property of the base class of another base class?

假设,我有以下情况:

class TopBaseClass:
    ... ...
    ... ...
    @property
    def top_property(self):
        return self.__top_property
    
    @top_property.setter
    def top_property(self, top_property):
        self.__top_property = top_property

class IntermediateBaseClass(TopBaseClass):
    ...

class LowestClass(IntermediateBaseClass):
    ... ...
    ... ...
    def lowest_function(self):
        something = ""

        ... ...
         
        return something

现在,我想从 lowest_function() 访问 top_property

我该怎么做?

我尝试了以下但没有成功:

something = str(super().super().top_property)

它给我一个错误。

那么,怎么做呢?

您想做的事情:

something = self.top_property

该属性是您的实例的一部分,可以直接引用。 getter 将用于检索值。