From 33bebf5e877b2a9d9ed5134014d75f9910cd890d Mon Sep 17 00:00:00 2001 From: gschwaer <3410079+gschwaer@users.noreply.github.com> Date: Mon, 29 Nov 2021 19:55:58 +0100 Subject: [PATCH] docs: add new option to documentation --- CHANGES | 2 ++ doc/usage/extensions/autodoc.rst | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index 0a465a5f2..80005b64f 100644 --- a/CHANGES +++ b/CHANGES @@ -23,6 +23,8 @@ Features added layout via CSS * #9899: py domain: Allows to specify cross-reference specifier (``.`` and ``~``) as ``:type:`` option +* #9792: autodoc: Add new option for ``autodoc_typehints_description_target`` to + include undocumented return values but not undocumented parameters. Bugs fixed ---------- diff --git a/doc/usage/extensions/autodoc.rst b/doc/usage/extensions/autodoc.rst index 5ac3cd171..86fed4a0b 100644 --- a/doc/usage/extensions/autodoc.rst +++ b/doc/usage/extensions/autodoc.rst @@ -622,8 +622,16 @@ There are also config values that you can set: When set to ``"documented"``, types will only be documented for a parameter or a return value that is already documented by the docstring. + With ``"returnvalue_and_documented_params"``, parameter types will only be + annotated if the parameter is documented in the docstring. The return type is + always annotated (except if it is ``None``). + .. versionadded:: 4.0 + .. versionadded:: 4.4 + + New option ``'returnvalue_and_documented_params'`` is added. + .. confval:: autodoc_type_aliases A dictionary for users defined `type aliases`__ that maps a type name to the