mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7442 from tk0miya/7435_typehints_not_suppressed_for_class
Fix #7435: autodoc_typehints doesn't suppress typehints for classes/methods
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -22,6 +22,8 @@ Bugs fixed
|
||||
* #7418: std domain: duplication warning for glossary terms is case insensitive
|
||||
* #7438: C++, fix merging overloaded functions in parallel builds.
|
||||
* #7422: autodoc: fails with ValueError when using autodoc_mock_imports
|
||||
* #7435: autodoc: ``autodoc_typehints='description'`` doesn't suppress typehints
|
||||
in signature for classes/methods
|
||||
* #7423: crashed when giving a non-string object to logger
|
||||
* #7479: html theme: Do not include xmlns attribute with HTML 5 doctype
|
||||
* #7426: html theme: Escape some links in HTML templates
|
||||
|
||||
@@ -1174,7 +1174,7 @@ class ClassDocumenter(DocstringSignatureMixin, ModuleLevelDocumenter): # type:
|
||||
return ret
|
||||
|
||||
def format_args(self, **kwargs: Any) -> str:
|
||||
if self.env.config.autodoc_typehints == 'none':
|
||||
if self.env.config.autodoc_typehints in ('none', 'description'):
|
||||
kwargs.setdefault('show_annotation', False)
|
||||
|
||||
# for classes, the relevant signature is the __init__ method's
|
||||
@@ -1430,7 +1430,7 @@ class MethodDocumenter(DocstringSignatureMixin, ClassLevelDocumenter): # type:
|
||||
return ret
|
||||
|
||||
def format_args(self, **kwargs: Any) -> str:
|
||||
if self.env.config.autodoc_typehints == 'none':
|
||||
if self.env.config.autodoc_typehints in ('none', 'description'):
|
||||
kwargs.setdefault('show_annotation', False)
|
||||
|
||||
unwrapped = inspect.unwrap(self.object)
|
||||
|
||||
Reference in New Issue
Block a user