mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Feature: enhance autoclass:: to use the docstring of __new__
The method new is an alternative to __init__, but autoclass does not respect __new__. This commit enhances the directive autoclass:: to try __new__ method's docstring, if __init__ method's docstring is missing or empty. The commit also adds tests and updates the documentation.
This commit is contained in:
@@ -314,6 +314,12 @@ There are also new config values that you can set:
|
||||
|
||||
.. versionadded:: 0.3
|
||||
|
||||
If the class has no ``__init__`` method or if the ``__init__`` method's
|
||||
docstring is empty, but the class has a ``__new__`` method's docstring,
|
||||
it is used instead.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
.. confval:: autodoc_member_order
|
||||
|
||||
This value selects if automatically documented members are sorted
|
||||
|
||||
Reference in New Issue
Block a user