From 9cda8c2a52281fbe101d559fa5ae797333dae9a7 Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 20 Feb 2013 23:45:40 +0430 Subject: [PATCH] fix list comprehensions recursion problems --- jedi/recursion.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jedi/recursion.py b/jedi/recursion.py index 09d2e937..a3a41006 100644 --- a/jedi/recursion.py +++ b/jedi/recursion.py @@ -87,8 +87,12 @@ class RecursionNode(object): def __eq__(self, other): if not other: return None + + is_list_comp = lambda x: isinstance(x, pr.ForFlow) and x.is_list_comp return self.script == other.script \ and self.position == other.position \ + and not is_list_comp(self.stmt.parent) \ + and not is_list_comp(other.parent) \ and not self.is_ignored and not other.is_ignored