From 371ec888e948849d568b2a9b9f3bab01f4a32074 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 12 Jun 2014 11:20:46 +0200 Subject: [PATCH] further test for list comprehensions --- jedi/evaluate/recursion.py | 3 +++ test/completion/dynamic.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jedi/evaluate/recursion.py b/jedi/evaluate/recursion.py index 1200da57..e67f8fd6 100644 --- a/jedi/evaluate/recursion.py +++ b/jedi/evaluate/recursion.py @@ -88,6 +88,9 @@ class _RecursionNode(object): if not other: return None + # List Comprehensions start on the same line as its statement. + # Therefore we have the unfortunate situation of the same start_pos for + # two statements. is_list_comp = lambda x: isinstance(x, pr.ListComprehension) return self.script == other.script \ and self.position == other.position \ diff --git a/test/completion/dynamic.py b/test/completion/dynamic.py index 7214af13..a50b5e39 100644 --- a/test/completion/dynamic.py +++ b/test/completion/dynamic.py @@ -400,7 +400,8 @@ third()[0] # ----------------- def from_comprehension(foo): - #? float() + #? int() float() return foo [from_comprehension(1.0) for n in (1,)] +[from_comprehension(n) for n in (1,)]