Skip to content

BUG: Rewrite inspect.unwrap() to respect classes #464

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

USSX-Hares
Copy link

@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

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
1 participant