- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Overridden, overloaded class docstring return type rendered as None #10280
Comments
This is not related to overloaded constructors. Autodoc automatically fills return value annotation to the signature definitions in the docstring excluding the first entry unexpectedly. So I reproduced this with this class:
I agree this is not unexpected behavior. So I'll fix this soon. Note: The example you given uses |
…return typehint Basically, autodoc suppresses return value typehint for class constructors. But it was unexpectedly shown if `autodoc_docstring_signature` is enabled and docstring has multiple signatures.
9f52d7d fixes it. Thanks! |
…return typehint Basically, autodoc suppresses return value typehint for class constructors. But it was unexpectedly shown if `autodoc_docstring_signature` is enabled and docstring has multiple signatures.
…trings Fix #10280: autodoc_docstring_signature generates needless return typehint
Describe the bug
Some overloaded class definitions show
None
as a return type, when there shouldn't be any return type.This seems to happen when the overloaded functions are overridden in the final docstring.
A class without this problem is also provided for comparison.
How to Reproduce
Exactly the same as #10278
Expected behavior
Your project
https://github.com/pybricks/sphinx-issues-minimal
Screenshots
OS
Ubuntu
Python version
3.8.3
Sphinx version
4.4.0
Sphinx extensions
'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'sphinx_rtd_theme'
Extra tools
No response
Additional context
Related Sphinx issue: #10281
This was originally reported in pybricks/pybricks-api#87
The text was updated successfully, but these errors were encountered: