mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #9110: autodoc: metadata of GenericAlias is not rendered as a reference in py37+
GenericAliasMixin should use `restify()` to render the metadata of GenericAlias as py36 does.
This commit is contained in:
parent
9105635389
commit
58ec5c4089
2
CHANGES
2
CHANGES
@ -17,6 +17,8 @@ Features added
|
||||
--------------
|
||||
|
||||
* #8818: autodoc: Super class having ``Any`` arguments causes nit-picky warning
|
||||
* #9110: autodoc: metadata of GenericAlias is not rendered as a reference in
|
||||
py37+
|
||||
* #9103: LaTeX: imgconverter: conversion runs even if not needed
|
||||
* #8127: py domain: Ellipsis in info-field-list causes nit-picky warning
|
||||
* #9023: More CSS classes on domain descriptions, see :ref:`nodes` for details.
|
||||
|
@ -1767,8 +1767,7 @@ class GenericAliasMixin(DataDocumenterMixinBase):
|
||||
|
||||
def update_content(self, more_content: StringList) -> None:
|
||||
if inspect.isgenericalias(self.object):
|
||||
alias = stringify_typehint(self.object)
|
||||
more_content.append(_('alias of %s') % alias, '')
|
||||
more_content.append(_('alias of %s') % restify(self.object), '')
|
||||
more_content.append('', '')
|
||||
|
||||
super().update_content(more_content)
|
||||
|
@ -1915,7 +1915,7 @@ def test_autodoc_GenericAlias(app):
|
||||
'',
|
||||
' A list of int',
|
||||
'',
|
||||
' alias of List[int]',
|
||||
' alias of :class:`~typing.List`\\ [:class:`int`]',
|
||||
'',
|
||||
'',
|
||||
'.. py:data:: T',
|
||||
@ -1923,7 +1923,7 @@ def test_autodoc_GenericAlias(app):
|
||||
'',
|
||||
' A list of int',
|
||||
'',
|
||||
' alias of List[int]',
|
||||
' alias of :class:`~typing.List`\\ [:class:`int`]',
|
||||
'',
|
||||
]
|
||||
|
||||
|
@ -156,7 +156,7 @@ def test_autoattribute_GenericAlias(app):
|
||||
'',
|
||||
' A list of int',
|
||||
'',
|
||||
' alias of List[int]',
|
||||
' alias of :class:`~typing.List`\\ [:class:`int`]',
|
||||
'',
|
||||
]
|
||||
|
||||
|
@ -96,7 +96,7 @@ def test_autodata_GenericAlias(app):
|
||||
'',
|
||||
' A list of int',
|
||||
'',
|
||||
' alias of List[int]',
|
||||
' alias of :class:`~typing.List`\\ [:class:`int`]',
|
||||
'',
|
||||
]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user