mirror of
https://github.com/davidhalter/jedi.git
synced 2026-02-21 12:58:29 +08:00
Implement Import.is_nested method.
This commit is contained in:
@@ -212,9 +212,10 @@ def get_module_statements(module):
|
||||
return new
|
||||
|
||||
stmts = set()
|
||||
imports = set()
|
||||
import_names = set()
|
||||
for scope in module.walk():
|
||||
imports |= set(scope.imports)
|
||||
for imp in set(scope.imports):
|
||||
import_names |= set(imp.get_defined_names())
|
||||
stmts |= add_stmts(scope.statements)
|
||||
stmts |= add_stmts(r for r in scope.returns if r is not None)
|
||||
|
||||
@@ -224,4 +225,4 @@ def get_module_statements(module):
|
||||
pass
|
||||
else:
|
||||
stmts |= add_stmts(decorators)
|
||||
return stmts, imports
|
||||
return stmts, import_names
|
||||
|
||||
Reference in New Issue
Block a user