1
Vote

"from module import " displays members merged from all possible imports

description

Given the following structure:
\
\package1\
\package1\__init__.py
\package1\test.py
\test\__init__.py
\run.py
Where package1\__init__.py includes "from test import *", it will either import from test\__init__.py or test.py depending on Python version and/or from __future__ declarations.

In PTVS, typing "from test import " will display the contents of both modules. The correct behavior would be to resolve it to exactly one module and only display those members.

Typing "import test" will import both modules and assign them to 'test', so that viewing members will show the union/intersection (depending on user setting). The correct behavior would be to import exactly one module.

(If you finish typing "from test import *" then the correct members will be available later. If you import a specific name it will be an unknown type if it is from the wrong module.)

comments