Repository navigation
Document that deprecated_aliases() needs __all__ - #221
Merged
Merged
Conversation
A star import only asks the module `__getattr__` for names listed in `__all__`, so in a module without one the aliases silently disappear from `from module import *`, and code using them fails with a `NameError` instead of getting the deprecation warning. Warn about it in the docstring, and add `__all__` to the usage example and the README example so copying them does the right thing. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
llucax
requested review from
daniel-zullo-frequenz
and removed request for
a team
November 5, 2026 15:20
llucax
enabled auto-merge
November 6, 2026 10:55
daniel-zullo-frequenz
approved these changes
Nov 6, 2026
Merged
via the queue into
frequenz-floss:v1.x.x
with commit Nov 6, 2026
36c6470
12 of 13 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A star import only asks a module's
__getattr__for names in__all__, so without one, aliases made withdeprecated_aliases()vanish fromfrom module import *and fail later with aNameErrorinstead of warning. This came up in a review of frequenz-floss/frequenz-channels-python#590.This adds a warning about it to the
deprecated_aliases()docstring, and__all__to its usage example and the README example. Docs only, so no release notes.