Skip to content

Commit e33134f

Browse files
authored
Merge pull request #9590 from tk0miya/9589_Annotated
Fix #9589: autodoc: typing.Annotated has wrongly been rendered
2 parents f127a2f + b82d3ef commit e33134f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ Bugs fixed
6262

6363
* #9504: autodoc: generate incorrect reference to the parent class if the target
6464
class inherites the class having ``_name`` attribute
65-
* #9537: autodoc: Some objects under ``typing`` module are not displayed well
66-
with the HEAD of 3.10
65+
* #9537, #9589: autodoc: Some objects under ``typing`` module are not displayed
66+
well with the HEAD of 3.10
6767
* #9512: sphinx-build: crashed with the HEAD of Python 3.10
6868

6969
Testing

sphinx/util/typing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ def stringify(annotation: Any) -> str:
315315
return 'None'
316316
elif annotation in INVALID_BUILTIN_CLASSES:
317317
return INVALID_BUILTIN_CLASSES[annotation]
318+
elif str(annotation).startswith('typing.Annotated'): # for py310+
319+
pass
318320
elif (getattr(annotation, '__module__', None) == 'builtins' and
319321
getattr(annotation, '__qualname__', None)):
320322
if hasattr(annotation, '__args__'): # PEP 585 generic

0 commit comments

Comments
 (0)