-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Milestone
Description
Describe the bug
Simple example below.
The TypeVar seems to get converted into py:data and thus we get an error when the type info in the signature or description tries to link to a py:class for it.
repro.py:docstring of repro.test:: WARNING: py:class reference target not found: repro.T
How to Reproduce
With the below files in a folder, run sphinx-build -Eanb html . build/
index.rst
Repro Warning
=============
.. automodule:: repro
:members:
:undoc-members:
:show-inheritance:conf.py
import os
import sys
sys.path.insert(0, os.path.abspath('.'))
extensions = ["sphinx.ext.autodoc"]
autodoc_typehints = "both"repro.py
from typing import TypeVar
T = TypeVar("T")
""" A Generic type """
def test(a: T) -> T:
"""A Test Function"""
return aEnvironment Information
Platform: linux; (Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.31)
Python version: 3.10.7 (main, Sep 6 2022, 21:51:06) [GCC 9.4.0])
Python implementation: CPython
Sphinx version: 5.3.0
Docutils version: 0.17.1
Jinja2 version: 3.1.2
Sphinx extensions
autodoc
Additional context
No response
AiyionPrime, Gallaecio, jab, dstansby, dimaqq and 3 more
Metadata
Metadata
Assignees
Labels
No labels