-
-
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
autodoc_type_aliases
does not resolve in 3.10
#10455
Comments
Why do you think so? AFAIK, it's still needed. |
In addition, autodoc should link the return value of |
Actually, the return type is not formatted at the same place as the parameters list and that's why you end up with signatures where you don't have clickable types. This is a bug but since autodoc may be completely rewritten at some point, I think we shouldn't implement something that may change entirely in the future. Nothing is planned yet but I am sorry that we probably won't fix this one before deciding what to do with autodoc itself. |
@picnixz this can work if using a workaround, as shown with some further diagnostic in this answer from #10785 . A couple of additional related notes:
|
Actually I usually solve these issues by applying my own transformations and resolving references abruptly. However with PEP 695, we need to rethink how we will document type aliases in general, hence I don't want to start something that is likely to be modified. |
Describe the bug
I expected
to work, but it does nothing in python 3.10, where
from __future__ import annotations
should be unnecessary
How to Reproduce
Expected behavior
Resulting build to show
func() -> AliasType
but instead we still find
func() -> int | float
Your project
.
Screenshots
No response
OS
Win
Python version
3.10
Sphinx version
4.5.0
Sphinx extensions
sphinx.ext.autodoc
Extra tools
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: