diff --git a/jedi/evaluate/representation.py b/jedi/evaluate/representation.py index 27473481..d125ece7 100644 --- a/jedi/evaluate/representation.py +++ b/jedi/evaluate/representation.py @@ -717,7 +717,10 @@ class ModuleWrapper(use_metaclass(CachedMetaClass, pr.Module, Wrapper)): yield dict((str(n), [GlobalName(n)]) for n in self.base.global_names) yield self._sub_modules_dict() - @cache_star_import + # I'm not sure if the star import cache is really that effective anymore + # with all the other really fast import caches. Recheck. Also we would need + # to push the star imports into Evaluator.modules, if we reenable this. + #@cache_star_import @memoize_default([]) def star_imports(self): modules = [] diff --git a/scripts/memory_check.py b/scripts/memory_check.py index 0ffe0682..7bbcad2b 100755 --- a/scripts/memory_check.py +++ b/scripts/memory_check.py @@ -42,15 +42,17 @@ def main(mods): for mod in mods: elapsed, used = profile_preload(mod) if used > 0: - print('%8.1f | %8d | %s' % (elapsed, used, mod)) + print('%8.2f | %8d | %s' % (elapsed, used, mod)) print('------------------------------') elapsed = time.time() - t0 used = used_memory() - baseline - print('%8.1f | %8d | %s' % (elapsed, used, 'Total')) + print('%8.2f | %8d | %s' % (elapsed, used, 'Total')) if __name__ == '__main__': - mods = ['re', 'numpy', 'scipy', 'scipy.sparse', 'scipy.stats', - 'wx', 'decimal', 'PyQt4.QtGui', 'PySide.QtGui', 'Tkinter'] - mods += sys.argv[1:] + if sys.argv[1:]: + mods = sys.argv[1:] + else: + mods = ['re', 'numpy', 'scipy', 'scipy.sparse', 'scipy.stats', + 'wx', 'decimal', 'PyQt4.QtGui', 'PySide.QtGui', 'Tkinter'] main(mods) diff --git a/test/completion/import_tree/__init__.py b/test/completion/import_tree/__init__.py index 58305c22..5cbbcd7d 100644 --- a/test/completion/import_tree/__init__.py +++ b/test/completion/import_tree/__init__.py @@ -2,4 +2,6 @@ a = '' from . import invisible_pkg +the_pkg = invisible_pkg + invisible_pkg = 1 diff --git a/test/completion/imports.py b/test/completion/imports.py index 2134501e..2e5509d1 100644 --- a/test/completion/imports.py +++ b/test/completion/imports.py @@ -121,6 +121,14 @@ def test_import_priorities(): from import_tree import the_pkg, invisible_pkg #? int() invisible_pkg + # In real Python, this would be the module, but it's not, because Jedi + # doesn't care about most stateful issues such as __dict__, which it would + # need to, to do this in a correct way. + #? int() + the_pkg + # Importing foo is still possible, even though inivisible_pkg got changed. + #? float() + from import_tree.invisible_pkg import foo # -----------------