-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve docstring return output with typing in sphinx
#375
Comments
I'm happy to experiment with this |
@ntessore I'm looking at this as part of #188, have got something like: # -- autodoc -----------------------------------------------------------------
autodoc_typehints = "description"
# -- napoleon ----------------------------------------------------------------
napoleon_google_docstring = False
napoleon_use_rtype = False
# -- sphinx-autodoc-typehints ----------------------------------------------------------------
always_use_bars_union = True
typehints_use_rtype = False
typehints_defaults = "comma" with these settings, but I can't work out how to get rid of the redundant |
To be honest, I am starting to think perhaps having separate "returns" and "return type" sections is a feature, not a bug. For simple return types, this isn't the worst output:
Whereas for complicated situations, having both sections allows for much more nuance:
|
Perhaps a good question to answer first is whether the documentation of |
Discussed in a call. Going to keep |
In addition, just now I experimented a bit with https://github.com/tox-dev/sphinx-autodoc-typehints and this could provide the kind of annotation we would like to see:
Which produces:
Originally posted by @ntessore in #373 (comment)
The text was updated successfully, but these errors were encountered: