Skip to content
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

Fix for #12463: empty __all__ is ignored in autosummary #13187

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

Conversation

vpratz
Copy link

@vpratz vpratz commented Dec 20, 2024

Subject: Fix for #12463: empty __all__ is ignored in autosummary

Feature or Bugfix

  • Bugfix

Purpose

The check for the absence of __all__ used the all or dir(obj) syntax. Unfortunately, this resolves to the second value not only for None, but also for an empty list. This lead to the unintended behavior that setting __all__ = [] was ignored by autosummary. Checking explicitly for None fixes this.

Detail

Please refer to #12463 for details on the issue and a reproducible example. The test in this PR also reproduces the behavior. It fails for the current master, but passes with the supplied change.

Relates

The check for the absence of `__all__` used the `all or dir(obj)`
syntax. Unfortunately, this resolves to the second value
not only for `None`, but also for an empty list. This lead to
the unintended behavior that setting `__all__ = []` was ignored
by autosummary. Checking explicitly for None fixes this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant