1
0
forked from VimPlug/jedi

star caching preparations

This commit is contained in:
David Halter
2012-11-21 13:45:38 +01:00
parent 395c5cd101
commit 890748ac9f
3 changed files with 22 additions and 15 deletions
+2
View File
@@ -86,6 +86,8 @@ def clear_caches():
follow_statement.reset()
imports.imports_processed = 0
def memoize_default(default=None):
"""
+8
View File
@@ -264,6 +264,12 @@ def strip_imports(scopes):
return result
def star_import_cache(func):
def wrapper(scope, *args, **kwargs):
return func(scope, *args, **kwargs)
return wrapper
@star_import_cache
def remove_star_imports(scope, ignored_modules=[]):
"""
Check a module for star imports:
@@ -279,4 +285,6 @@ def remove_star_imports(scope, ignored_modules=[]):
modules += new
# Filter duplicate modules.
if len(modules) > 10:
print scope, len(modules)
return set(modules)