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,)]