1
0
forked from VimPlug/jedi

get rid of is_list_comp boolean in favor of a direct check of ListComprehensionFlow

This commit is contained in:
Dave Halter
2014-06-09 20:19:31 +02:00
parent dd8e4341db
commit 0b926ca454
7 changed files with 17 additions and 21 deletions
+2 -3
View File
@@ -316,8 +316,7 @@ class NameFinder(object):
return res_new + evaluator.eval_statement(param, seek_name=unicode(self.name_str))
def _handle_for_loops(self, loop):
# Take the first statement (for has always only
# one, remember `in`). And follow it.
# Take the first statement (for has always only one`in`).
if not loop.inputs:
return []
result = iterable.get_iterator_types(self._evaluator.eval_statement(loop.inputs[0]))
@@ -494,7 +493,7 @@ def get_names_of_scope(evaluator, scope, position=None, star_search=True, includ
yield scope, _get_defined_names_for_position(scope, position, in_func_scope)
except StopIteration:
reraise(common.MultiLevelStopIteration, sys.exc_info()[2])
if scope.isinstance(pr.ForFlow) and scope.is_list_comp:
if scope.isinstance(iterable.ListComprehensionFlow):
# is a list comprehension
yield scope, scope.get_defined_names(is_internal_call=True)