Resolve members of all imported modules in both __init__.py and submodules (PY-14454, PY-14615)

We used to resolve members __init__.py of imported packages using only
the __init__.py itself, i.e. without considering their submodules. Now
we do that and we also don't filter unimported submodules because we
cannot detect them reliably. They might be imported in other modules
via some import chain.
This commit is contained in:
Andrey Vlasovskikh
2015-07-02 17:38:25 +03:00
parent c008e30791
commit ac05b12d26
21 changed files with 33 additions and 42 deletions
@@ -0,0 +1,5 @@
import pkg1.m1
print(pkg1.m2)
print(pkg1.<warning descr="Cannot find reference 'nonexistent' in 'imported module pkg1'">nonexistent</warning>)
@@ -1,5 +0,0 @@
import nspkg1.m2
print(nspkg1.m2)
print(nspkg1.<warning descr="Cannot find reference 'm3' in 'imported module nspkg1'">m3</warning>)
print(nspkg1.<warning descr="Cannot find reference 'nssubpkg1' in 'imported module nspkg1'">nssubpkg1</warning>)
@@ -1 +0,0 @@
a1 = 42
@@ -1 +0,0 @@
a2 = -1
@@ -1,3 +0,0 @@
import p1.m1
print(p1.<warning descr="Cannot find reference 'm2' in 'imported module p1'">m2</warning>.a2)
@@ -0,0 +1,4 @@
from pkg1 import m1
print(m1)
# <ref>
@@ -0,0 +1 @@
__all__ = ['m1']
@@ -0,0 +1,2 @@
def foo():
pass
@@ -1,4 +1,4 @@
from pkg1 import m1
import pkg1.m1
print(m1)
# <ref>
print(pkg1.m1)
# <ref>