mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
+5
@@ -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
@@ -0,0 +1 @@
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
import pkg1.m2
|
||||
+1
@@ -0,0 +1 @@
|
||||
|
||||
-5
@@ -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)
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
from pkg1 import m1
|
||||
|
||||
print(m1)
|
||||
# <ref>
|
||||
@@ -0,0 +1 @@
|
||||
__all__ = ['m1']
|
||||
@@ -0,0 +1,2 @@
|
||||
def foo():
|
||||
pass
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
from pkg1 import m1
|
||||
import pkg1.m1
|
||||
|
||||
print(m1)
|
||||
# <ref>
|
||||
print(pkg1.m1)
|
||||
# <ref>
|
||||
|
||||
Reference in New Issue
Block a user