From 96bb9e3c1a3215cb20a44bd4e0e11048d1048499 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 2 Jan 2017 12:15:09 +0100 Subject: [PATCH] LazyContext.infer() should return a set. --- jedi/evaluate/context.py | 2 +- test/completion/generators.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jedi/evaluate/context.py b/jedi/evaluate/context.py index 2b2080a1..8a81428c 100644 --- a/jedi/evaluate/context.py +++ b/jedi/evaluate/context.py @@ -98,7 +98,7 @@ class AbstractLazyContext(object): class LazyKnownContext(AbstractLazyContext): """data is a context.""" def infer(self): - yield self.data + return set([self.data]) class LazyKnownContexts(AbstractLazyContext): diff --git a/test/completion/generators.py b/test/completion/generators.py index d8eba2dd..6ffd11a2 100644 --- a/test/completion/generators.py +++ b/test/completion/generators.py @@ -108,7 +108,7 @@ for c in Counter(3, 8): # ----------------- -# tuples +# tuple assignments # ----------------- def gen(): if random.choice([0,1]): @@ -148,6 +148,9 @@ a #? str() b +a, = (a for a in [1]) +#? int() +a # ----------------- # More complicated access