-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Milestone
Description
Describe the bug
autodoc typehints normally generate a link to the hinted type, but do not do so for parametrized types.
To Reproduce
Steps to reproduce the behavior:
$ cat >project.py <<EOF
from typing import Literal
def func(x: Literal["a", "b"], y: int):
"""
:param x: The x.
:param y: The y.
"""
EOF
sphinx-apidoc . -o . -F -A me -V 0.0 --extensions sphinx.ext.intersphinx
PYTHONPATH=. make O=-Dautodoc_typehints=description html
and open _build/html/project.html
Expected behavior
Literal (in the parameter description) should link to typing.Literal in CPython's docs, just like int does.
Your project
N/A
Environment info
- OS: linux
- Python version: 3.9.4
- Sphinx version: 4.0.0
- Sphinx extensions: intersphinx, autodoc
- Extra tools: N/A
Additional context
N/A
