Skip to content

Fix: include members whitelisted in __pdoc__ when __all__ is defined - #486

Open
Shiroe-95 wants to merge 2 commits into
pdoc3:masterfrom
Shiroe-95:fix/all-whitelisted-members
Open

Shiroe-95 wants to merge 2 commits into
pdoc3:masterfrom
Shiroe-95:fix/all-whitelisted-members

Conversation

@Shiroe-95

Copy link
Copy Markdown

Fixes #230

When a module defines __all__, members that are not listed there but are whitelisted in __pdoc__ (__pdoc__['name'] = True) were ignored, although the documentation says this should include them.

Now, after the members listed in __all__, pdoc also adds the module's own members (or ones with a PEP-224 docstring) that are whitelisted and not blacklisted. The is_from_this_module helper moved out of the else branch so both branches share it. Modules without __all__ behave as before.

  • Added test__all__whitelist, which fails without the change.
  • python -m unittest pdoc.test: 83 tests pass. test_lunr_search errors both with and without this change (it needs Node).

AI disclosure: this change was prepared with Claude (Claude Code, Anthropic) at the submitter's request.

Signed-off-by: Wilson Vargas Martinez <wvargasm4887@universidadean.edu.co>
Add test for __all__ whitelist functionality in pdoc.

Signed-off-by: Wilson Vargas Martinez <wvargasm4887@universidadean.edu.co>

This branch has not been deployed

No deployments
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.

Whitelisting with __all__

1 participant