From 2f1578348297272325468a3cddb0bd3a90d444c3 Mon Sep 17 00:00:00 2001 From: Matt Wozniski Date: Mon, 14 Dec 2020 17:09:13 -0500 Subject: [PATCH] Use __init__ type hints in "description" mode Previously, `__init__` type hints were not used when documenting a class using `autodoc_typehints="description"`. This was done to prevent documentation for parameters from showing up twice, but that will no longer occur now that parameter and return types are only inserted if the parameter or return has a description. Closes #8178 --- sphinx/ext/autodoc/typehints.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/sphinx/ext/autodoc/typehints.py b/sphinx/ext/autodoc/typehints.py index 501360b1500..573f5affee8 100644 --- a/sphinx/ext/autodoc/typehints.py +++ b/sphinx/ext/autodoc/typehints.py @@ -42,8 +42,6 @@ def merge_typehints(app: Sphinx, domain: str, objtype: str, contentnode: Element return if app.config.autodoc_typehints != 'description': return - if objtype == 'class' and app.config.autoclass_content not in ('init', 'both'): - return try: signature = cast(addnodes.desc_signature, contentnode.parent[0])