-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
A normal from foo import bar in module a should not allow another module to do from a import bar; an explicit from foo import bar as bar should be required to specify a re-export.
In the current typing spec, these rules are worded as applicable to all modules. Mypy does apply them in all modules, pyright applies them only in type stubs.
I have a vague memory that these originated as stub-only conventions, but I haven't been able to dig up confirmation.
We need to decide if we will apply these conventions in all modules, or only in stubs, and then implement them accordingly.
In particular this is problematic at the moment because we don't apply these conventions in builtins.pyi, meaning we understand all symbols imported into builtins.pyi (e.g. various typing module symbols) as builtin names.