Tag: autodoc

如何使用Sphinx的autodoc来logging类的__init __(self)方法?

Sphinx默认情况下不会为__init __(self)生成文档。 我已经尝试了以下内容: .. automodule:: mymodule :members: 和 ..autoclass:: MyClass :members: 在conf.py中,设置以下内容只会将__init __(self)docstring附加到类docstring中( Sphinx autodoc文档似乎认同这是预期的行为,但没有提到我正试图解决的问题): autoclass_content = 'both'