Skip to content

Commit

Permalink
Merge pull request #9590 from tk0miya/9589_Annotated
Browse files Browse the repository at this point in the history
Fix #9589: autodoc: typing.Annotated has wrongly been rendered
  • Loading branch information
tk0miya committed Aug 29, 2021
2 parents f127a2f + b82d3ef commit e33134f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGES
Expand Up @@ -62,8 +62,8 @@ Bugs fixed

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

Testing
Expand Down
2 changes: 2 additions & 0 deletions sphinx/util/typing.py
Expand Up @@ -315,6 +315,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)):
if hasattr(annotation, '__args__'): # PEP 585 generic
Expand Down

0 comments on commit e33134f

Please sign in to comment.