From 818730d6eaa9ccbdf345aa1ad2a209724ef20ad2 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 15 May 2016 23:32:16 +0200 Subject: [PATCH] Fix descriptions for REPL. --- jedi/api/interpreter.py | 2 +- jedi/evaluate/finder.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jedi/api/interpreter.py b/jedi/api/interpreter.py index c858c462..0359675d 100644 --- a/jedi/api/interpreter.py +++ b/jedi/api/interpreter.py @@ -116,7 +116,7 @@ class LazyName(helpers.FakeName): evaluated = compiled.create(self._evaluator, obj) found = [evaluated] - if len(found) > 1 or True: + if len(found) > 1: content = iterable.AlreadyEvaluated(found) stmt = pt.ExprStmt([self, pt.Operator(pt.zero_position_modifier, '=', (0, 0), ''), content]) diff --git a/jedi/evaluate/finder.py b/jedi/evaluate/finder.py index 63123acc..c583aa28 100644 --- a/jedi/evaluate/finder.py +++ b/jedi/evaluate/finder.py @@ -153,6 +153,13 @@ class NameFinder(object): last_names.append(name) continue + if isinstance(stmt, er.ModuleWrapper): + # In case of REPL completion, we can infer modules names that + # don't really have a definition (because they are really just + # namespaces). In this case we can just add it. + last_names.append(name) + continue + if isinstance(name, compiled.CompiledName) \ or isinstance(name, er.InstanceName) and isinstance(name._origin_name, compiled.CompiledName): last_names.append(name)