Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Don't reexport star-imported symbols when implicit reexports are disabled #7361
Based on #7099, please see only the second commit.
Currently, in regular files, symbols imported into module A with
This behavior makes sense in stub files as a shorthand (and is specified
The natural expectation is that when a variable is explicitly added to a module's `__all__`, the module explicitly means to export it. Previously, this was not the case, and a `from [..] import [..] as [..]` reexport was required by `--no-implicit-export` even if the variable is listed in `__all__`. Fixes #7042
…bled Currently, in regular files, symbols imported into module A with `from B import *` are considered explicitly exported from module B as well, i.e. they are considered part of module's B public API. This behavior makes sense in stub files as a shorthand (and is specified in PEP 484), but for regular files I think it is better to be explicit: add the symbols to `__all__`. Further discussion: #7042 (comment)