Closed harupy closed 3 years ago
ClassDocumenter
doesn't seem to set follow_wrapped
to True
when extracting a signature.
The same thing occurs here:
This causes type_sig
and sig
to have different parameters and throw KeyError
here:
@tk0miya Correct me if I'm wrong. It looks like just specifying follow_wrapped=True
solves the issue. If so, I'd be happy to open a PR (that makes the change and adds some tests to verify it).
@harupy You're right! Could you make a PR, please? Additionally, cases of __call__
and __new__
are also needed to add follow_wrapped=True
, I think. Could you check them too if possible?
@tk0miya Created a PR: https://github.com/sphinx-doc/sphinx/pull/8115 😄
This issue prevents me from upgrading from 3.0 to 3.2.1, the bugfix by @harupy works perfectly.
@tk0miya Could you review #8115?
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.