Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use Sphinx' Autodoc-extension for private methods?

I am using Sphinx for documenting my python project. I have the autodoc extension enabled and have the following in my docs.

.. autoclass:: ClassName    :members: 

The problem is, it only documents the non-private methods in the class. How do I include the private methods too?

like image 309
cnu Avatar asked Jul 19 '09 05:07

cnu


People also ask

How does Sphinx Autodoc work?

autodoc provides several directives that are versions of the usual py:module , py:class and so forth. On parsing time, they import the corresponding module and extract the docstring of the given objects, inserting them into the page source under a suitable py:module , py:class etc. directive.


1 Answers

if you are using sphinx 1.1 or above, from the sphinx documentation site at http://www.sphinx-doc.org/en/master/ext/autodoc.html,

:special-members: :private-members: 
like image 98
mariotomo Avatar answered Oct 05 '22 21:10

mariotomo