I have a base class Base and a derived class Derived. Using Sphinx, I want the class attributes of Base to appear in the documentation of Derived; I thought :inherited-members: would do the trick, but I'm having no luck so far.
Note that unlike this question, the members I need to document do not appear hard-coded in the class, only in the class docstring.
Minimal working example: under tmp/, I have the file a.py:
class Base:
"""
:param x: X
:type x: int
"""
x = 1
class Derived(Base):
"""
:param y: Y
:type y: int
"""
y = 2
the file index.rst:
Tmp
===
.. autoclass:: tmp.a.Base
:members:
.. autoclass:: tmp.a.Derived
:show-inheritance:
:inherited-members:
:members:
and conf.py, which only contains extensions = ['sphinx.ext.autodoc']. If I run the command
python -m sphinx.cmd.build . ./tmphtml/
then the output tmphtml/index.html shows this:
How can I get x to appear under the Parameters part of Derived? My current version of Sphinx is 3.3.1.
