如何在Sphinx文档中将成员注释为抽象?

cdw*_*son 6 python documentation abc python-sphinx

以下两个属性定义在Sphinx autodoc html输出中显示完全相同:

@property
def concrete(self):
    """This is the concrete docstring"""
    pass

@abstractproperty
def abstract(self):
    """This is the abstract docstring"""
    pass
Run Code Online (Sandbox Code Playgroud)

Sphinx是否有办法用某种标识符注释抽象方法?我希望在我的文档中可以明显看出我的ABC成员需要实现哪些,以及一旦定义了所需的,就会获得mixin免费赠品.

Ric*_*ren 1

Sphinx 似乎无法做到这一点。自 2011 年以来,它在Sphinx 的 bitbucket中被标记为一个未解决的问题,并被标记为 Sphinx 未来版本的里程碑。