From 774ade955d407720377ee673ae9ccbb5343dc7df Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 4 Dec 2014 17:58:01 +0100 Subject: [PATCH] Fixing for loop additions. --- jedi/evaluate/__init__.py | 5 ++--- test/completion/precedence.py | 10 ---------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/jedi/evaluate/__init__.py b/jedi/evaluate/__init__.py index af61266d..d797aa12 100644 --- a/jedi/evaluate/__init__.py +++ b/jedi/evaluate/__init__.py @@ -144,9 +144,8 @@ class Evaluator(object): name = str(stmt.get_defined_names()[0]) parent = er.wrap(self, stmt.get_parent_scope()) left = self.find_types(parent, name, stmt.start_pos) - # TODO REMOVE or implement - if False and isinstance(stmt.parent, pr.ForFlow): - # iterate through result and add the values, that's possible + if isinstance(stmt.get_parent_until(pr.ForStmt), pr.ForStmt): + # Iterate through result and add the values, that's possible # only in for loops without clutter, because they are # predictable. for r in types: diff --git a/test/completion/precedence.py b/test/completion/precedence.py index 552cf516..958f2701 100644 --- a/test/completion/precedence.py +++ b/test/completion/precedence.py @@ -108,16 +108,6 @@ for x in [l(0), l(1), l(2), l(3), l(4), l(5), l(6), l(7), l(8), l(9), l(10), b[1] -# ----------------- -# syntax errors -# ----------------- - -# strange slice -z = sorted([1], key = lambda x : x): -#? int() -z[0] - - # ----------------- # undefined names # -----------------