Documenting private (double underscore) class members

5 views
Skip to first unread message

Ian Pilcher

unread,
Feb 5, 2023, 8:58:03 PM2/5/23
to sphinx...@googlegroups.com
Is is possible to generate documentation for for private (double
underscore) class members?

I have tried passing the -P option to sphinx-apidoc, and I have also set
autodoc_default_options in my conf.py:

autodoc_default_options = {
'members': True,
'undoc-members': True,
'private-members': True
}

In both cases, class members whose names begin with two underscores are
not included in the generated documentation.

Is it possible to do this?

Thanks!

--
========================================================================
Google Where SkyNet meets Idiocracy
========================================================================

Pradyun Gedam

unread,
Feb 6, 2023, 6:29:20 AM2/6/23
to sphinx-users

Ian Pilcher

unread,
Feb 6, 2023, 12:30:07 PM2/6/23
to sphinx...@googlegroups.com
On 2/6/23 05:29, Pradyun Gedam wrote:
> You're looking for special-members.
>
> https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#directive-option-automodule-special-members

Actually, I'm was looking for private-members. special-members is for
members that have a double underscore at *both* the beginning and end of
their name. Members that have a double underscore *only* at the
beginning (which causes their names to be mangled) are covered by
private-members.

I'm having trouble getting it to work properly with an inner class, but
that's a subject for a different thread.
Reply all
Reply to author
Forward
0 new messages