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 uses a wrapper's signature for a decorated class #8105
Comments
sphinx/sphinx/ext/autodoc/__init__.py Line 1401 in 38b868c
|
The same thing occurs here: sphinx/sphinx/ext/autodoc/type_comment.py Lines 120 to 122 in 38b868c
This causes sphinx/sphinx/ext/autodoc/type_comment.py Line 125 in 38b868c
|
@tk0miya Correct me if I'm wrong. It looks like just specifying |
@harupy You're right! Could you make a PR, please? Additionally, cases of |
This issue prevents me from upgrading from 3.0 to 3.2.1, the bugfix by @harupy works perfectly. |
…orrect In sphinx-doc#7651, autodoc stops to undecorate the functions on getting the signature from the callables. But some kinds of decorators conceals the correct signature because they pass through their arguments via `(*args, **kwargs)`. This restarts to undecorate the functions again as before sphinx-doc#7651.
Fix #8105: autodoc: the signature of decorated class is incorrect
Describe the bug
autodoc
uses a wrapper's signature for a decorated class.To Reproduce
Branch: https://github.com/harupy/sphinx/tree/decorated-class
Steps to reproduce the behavior:
In
tests/roots/test-ext-autodoc/target/decorator.py
, add:.In
tests/test_ext_autodoc.py
, add:Then, run:
This outputs:
Expected behavior
A clear and concise description of what you expected to happen.
Your project
Link to your sphinx project, or attach zipped small project sample.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment info
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: