refactored code and tests, prepared for numpy feature

This commit is contained in:
Quentin Soubeyran
2020-11-18 11:18:52 +01:00
parent a60e1c10b7
commit ec30f77712
9 changed files with 101 additions and 44 deletions

View File

@@ -300,7 +300,7 @@ class ExamplePEP526Class:
If the class has public attributes, they may be documented here
in an ``Attributes`` section and follow the same formatting as a
function's ``Args`` section. If ``napoleon_google_attr_annotations``
function's ``Args`` section. If ``napoleon_attr_annotations``
is True, types can be specified in the class body using ``PEP 526``
annotations.

View File

@@ -302,7 +302,7 @@ sure that "sphinx.ext.napoleon" is enabled in `conf.py`::
napoleon_use_param = True
napoleon_use_rtype = True
napoleon_type_aliases = None
napoleon_google_attr_annotations = False
napoleon_attr_annotations = True
.. _Google style:
https://google.github.io/styleguide/pyguide.html
@@ -540,8 +540,10 @@ sure that "sphinx.ext.napoleon" is enabled in `conf.py`::
.. versionadded:: 3.2
.. confval:: napoleon_google_attr_annotations
.. confval:: napoleon_attr_annotations
True to allow using `PEP 526`_ attributes annotations in classes.
If an attribute is documented in the docstring without a type and
has an annotation in the class body, that type is used.
True to allow using `PEP 526`_ attributes annotations in classes.
If an attribute is documented in the docstring without a type and
has an annotation in the class body, that type is used.
.. versionadded:: 3.4