Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2021-08-29 09:40:49 +0300
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2021-08-29 09:51:39 +0300
commitb82d3ef05a75b6dad9679f8746db5ef89785c7c0 (patch)
tree53ddf3dd7ce9ebf27674b1a0a98864afc1c31088 /sphinx/util
parent9f46b1fa6712ce748899a5ab5a20e532c8976352 (diff)
Fix #9589: autodoc: typing.Annotated has wrongly been rendered
At the HEAD of 3.10, the implementation of `typing.Annotated` has been changed to have __qualname__.
Diffstat (limited to 'sphinx/util')
-rw-r--r--sphinx/util/typing.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
index df5277ae7..35f808211 100644
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -306,6 +306,8 @@ def stringify(annotation: Any) -> str:
return 'None'
elif annotation in INVALID_BUILTIN_CLASSES:
return INVALID_BUILTIN_CLASSES[annotation]
+ elif str(annotation).startswith('typing.Annotated'): # for py310+
+ pass
elif (getattr(annotation, '__module__', None) == 'builtins' and
getattr(annotation, '__qualname__', None)):
return annotation.__qualname__