Skip to content

Commit

Permalink
Fix sphinx-doc#9589: autodoc: typing.Annotated has wrongly been rendered
Browse files Browse the repository at this point in the history
At the HEAD of 3.10, the implementation of `typing.Annotated` has
been changed to have __qualname__.
  • Loading branch information
tk0miya committed Aug 29, 2021
1 parent 9f46b1f commit 17d588a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sphinx/util/typing.py
Expand Up @@ -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__
Expand Down

0 comments on commit 17d588a

Please sign in to comment.