mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-11-02 20:30:30 -06:00
Merge pull request #6873 from tk0miya/5923_autodoc_inherited_members_can_ignore_specific_superclass
Close #5923: autodoc: allow not to document inherited members of specific super class
This commit is contained in:
4 files changed
+83
-12
No files matched your search
@@ -157,7 +157,7 @@ inserting them into the page source under a suitable :rst:dir:`py:module`,
|
||||
|
||||
* For classes and exceptions, members inherited from base classes will be
|
||||
left out when documenting all members, unless you give the
|
||||
``inherited-members`` flag option, in addition to ``members``::
|
||||
``inherited-members`` option, in addition to ``members``::
|
||||
|
||||
.. autoclass:: Noodle
|
||||
:members:
|
||||
@@ -166,11 +166,29 @@ inserting them into the page source under a suitable :rst:dir:`py:module`,
|
||||
This can be combined with ``undoc-members`` to document *all* available
|
||||
members of the class or module.
|
||||
|
||||
It can take an anchestor class not to document inherited members from it.
|
||||
By default, members of ``object`` class are not documented. To show them
|
||||
all, give ``None`` to the option.
|
||||
|
||||
For example; If your class ``Foo`` is derived from ``list`` class and
|
||||
you don't want to document ``list.__len__()``, you should specify a
|
||||
option ``:inherited-members: list`` to avoid special members of list
|
||||
class.
|
||||
|
||||
Another example; If your class Foo has ``__str__`` special method and
|
||||
autodoc directive has both ``inherited-members`` and ``special-members``,
|
||||
``__str__`` will be documented as in the past, but other special method
|
||||
that are not implemented in your class ``Foo``.
|
||||
|
||||
Note: this will lead to markup errors if the inherited members come from a
|
||||
module whose docstrings are not reST formatted.
|
||||
|
||||
.. versionadded:: 0.3
|
||||
|
||||
.. versionchanged:: 3.0
|
||||
|
||||
It takes an anchestor class name as an argument.
|
||||
|
||||
* It's possible to override the signature for explicitly documented callable
|
||||
objects (functions, methods, classes) with the regular syntax that will
|
||||
override the signature gained from introspection::
|
||||
|
||||
Reference in new issue
Block a user