You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Module re-exports in stub files not handled correctly #3681
Mypy currently handles module re-exports in stub files the same way it handles them with regular Python files. That is, any symbol imported at the global level is available for re-export. However, PEP 484 contains the following lines in the section on stub files:
Modules and variables imported into the stub are not considered exported from the stub unless the import uses the import ... as ... form or the equivalent from ... import ... as ... form.
However, as an exception to the previous bullet, all objects imported into a stub using from ... import * are considered exported. (This makes it easier to re-export all objects from a given module that may vary by Python version.)
I suspect this may be a bit tricky to implement cleanly because iirc, mypy currently doesn't have a mechanism that lets symbols be defined inside a module while being hidden outside (in part because Python itself doesn't really have such a mechanism). Also, my "this might do weird things with incremental mode" senses are tingling.
Activity
ilevkivskyi commentedon Jul 8, 2017
Isn't this just a duplicate of #2927? Or is there something more? I was going to work on #2927 during next few days.
Michael0x2a commentedon Jul 8, 2017
Whoops, you're right -- it seems this is a dupe. Closing.