mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-14811 Handle references from __all__, defined indirectly in the module
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
__all__ = ['foo']
|
||||
|
||||
|
||||
class C(object):
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
|
||||
_c = C()
|
||||
|
||||
|
||||
def _init(g):
|
||||
for name in dir(_c):
|
||||
if not name.startswith('_'):
|
||||
g[name] = getattr(_c, name)
|
||||
|
||||
|
||||
_init(globals())
|
||||
@@ -0,0 +1,5 @@
|
||||
from b import foo
|
||||
|
||||
|
||||
def use_foo():
|
||||
print(foo)
|
||||
@@ -0,0 +1,5 @@
|
||||
from b import foo
|
||||
|
||||
|
||||
def use_foo():
|
||||
print(foo)
|
||||
@@ -0,0 +1,18 @@
|
||||
__all__ = ['foo']
|
||||
|
||||
|
||||
class C(object):
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
|
||||
_c = C()
|
||||
|
||||
|
||||
def _init(g):
|
||||
for name in dir(_c):
|
||||
if not name.startswith('_'):
|
||||
g[name] = getattr(_c, name)
|
||||
|
||||
|
||||
_init(globals())
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
|
||||
|
||||
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
__all__ = ['foo']
|
||||
|
||||
|
||||
class C(object):
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
|
||||
_c = C()
|
||||
|
||||
|
||||
def _init(g):
|
||||
for name in dir(_c):
|
||||
if not name.startswith('_'):
|
||||
g[name] = getattr(_c, name)
|
||||
|
||||
|
||||
_init(globals())
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
from b import foo as bar
|
||||
|
||||
|
||||
def use_foo():
|
||||
print(bar)
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
from b import foo as bar
|
||||
|
||||
|
||||
def use_foo():
|
||||
print(bar)
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
__all__ = ['foo']
|
||||
|
||||
|
||||
class C(object):
|
||||
def foo(self):
|
||||
pass
|
||||
|
||||
|
||||
_c = C()
|
||||
|
||||
|
||||
def _init(g):
|
||||
for name in dir(_c):
|
||||
if not name.startswith('_'):
|
||||
g[name] = getattr(_c, name)
|
||||
|
||||
|
||||
_init(globals())
|
||||
Reference in New Issue
Block a user