-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property gets linked instead of external type in class with inline type annotations #8992
Comments
Unfortunately, the real name of
As a result,
After that, the "traceback" name confuses Sphinx. |
Ah the So I guess the problem is that the |
Would you like to see |
I mean that it would become BTW, if it's rendered as .. py:method:: ExceptionInfo.from_exc_info(exc_info: Tuple[Type[example.E], example.E, traceback], exprinfo: Optional[str] = None) -> example.ExceptionInfo[example.E]
:module: example
:classmethod: maybe it makes sense to just skip properties when trying to resolve types. |
…ype annotation The builtin module, ``types.TracebackType`` does not have correct module name. This allows to refer it automatically.
…ype annotation The builtin module, ``types.TracebackType`` does not have correct module name. This allows to refer it automatically.
I just post #9015 to resolve the correct name of |
Fix #8992: autodoc: Failed to resolve types.TracebackType type annotation
Describe the bug
The project is using autodoc with inline Python type annotations. Given the following class (snipped to the relevant parts):
The class and
from_exc_info
method get rendered as follows:In the class, the
TracebackType
gets rendered astraceback
and is not linked.In the method, the
TracebackType
gets rendered astraceback
and links to thetraceback
property.Expected behavior
I expect it to show as
TracebackType
. Atraceback
is also OK I guess (if it's meant to refer to a "traceback object"), but in that case it should link to https://docs.python.org/3/library/types.html#types.TracebackType or https://docs.python.org/3/reference/datamodel.html#traceback-objects instead of the local property.To Reproduce
I can try to create a minimal reproduction if the above is not sufficient or gets outdated.
Your project
https://github.com/pytest-dev/pytest
Environment info
The text was updated successfully, but these errors were encountered: