我正在使用 Sphinx 来记录我的 python 项目。我启用了 autodoc 扩展,并且在我的文档中有以下内容。
.. autoclass:: ClassName
:members:
问题是,它只记录了类中的非私有(private)方法。我如何也包含私有(private)方法?
最佳答案
如果您使用的是 sphinx 1.1 或更高版本,请访问 sphinx 文档站点 http://www.sphinx-doc.org/en/master/ext/autodoc.html ,
:special-members:
:private-members:
关于python - 如何将 Sphinx 的 Autodoc 扩展用于私有(private)方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1149280/