Skip to content

Conversation

@USSX-Hares
Copy link
Contributor

@USSX-Hares USSX-Hares commented Jul 24, 2025

Closes #463

Changes

  • Added pdoc._unwrap_object() function which behaves like insepct.unwrap(), but respects classes
    • This function is used instead of inspect.unwrap() in the entire codebase
  • Added a test covering this specific case (pdoc.test.ApiTest.test_class_wrappers and pdoc.test.example_pkg._test_classwrap)

Code Quality

  • flake8 checks passed locally (added a single exception for long lines due to longer docstrings)
    • There was a single error on pdoc.cli#603, but I have not touched this file
  • Tests passed via tox on the following environments (os: Windows):
    • Python 3.9.12
    • Python 3.10.4
    • Python 3.11.9
    • Python 3.12.1
    • Python 3.12.10
    • Python 3.13.5
  • There are two mypy issues in the code I haven't touched, however

@USSX-Hares
Copy link
Contributor Author

USSX-Hares commented Oct 17, 2025

Hi, @kernc, could you review this PR?

1 similar comment
@USSX-Hares
Copy link
Contributor Author

Hi, @kernc, could you review this PR?

Fixes pdoc3#463

Post-review changes:
* Remove argument `stop` from `pdoc._unwrap_object()`
* Fix flake8 errors
@USSX-Hares USSX-Hares force-pushed the fix/463-inspect-unwrap-rewrite branch from 273f8e5 to 3db7827 Compare November 3, 2025 12:46
@kernc
Copy link
Member

kernc commented Nov 3, 2025

Lgtm, thanks!

@kernc kernc merged commit af49da6 into pdoc3:master Nov 3, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Ambigous usage of inspect.unwrap() on classes

2 participants