python sphinx自动文档不包括继承的文档成员

时间:2018-11-05 15:37:11

标签: python-sphinx autodoc

我使用sphinx为子类生成文档,但是即使配置了 inherited-members ,基类的doc成员也丢失了。但是当我配置 undoc-members 时,这些成员似乎没有任何文档。

我的模块-> test.py:

class Base:
    #: the charset for the request, defaults to utf-8
    charset = 'utf-8'


class Sub(Base):
    #: the error handling procedure for errors, defaults to 'replace'
    encoding_errors = 'replace'

我的文档-> api.rst:

Incoming Request Data
---------------------
.. module:: test
.. autoclass:: Sub
   :members:
   :inherited-members:

0 个答案:

没有答案