1
0
forked from VimPlug/jedi

Make the some names more concise in the parser tree.

This commit is contained in:
Dave Halter
2017-04-10 09:44:08 +02:00
parent 769cc80d6b
commit 218e715553
5 changed files with 21 additions and 16 deletions
+3 -2
View File
@@ -81,6 +81,7 @@ from jedi.evaluate import pep0484
from jedi.evaluate.filters import TreeNameDefinition, ParamName
from jedi.evaluate.instance import AnonymousInstance, BoundMethod
from jedi.evaluate.context import ContextualizedName, ContextualizedNode
from jedi import parser_utils
class Evaluator(object):
@@ -165,11 +166,11 @@ class Evaluator(object):
for_stmt = tree.search_ancestor(stmt, 'for_stmt')
if for_stmt is not None and for_stmt.type == 'for_stmt' and types \
and for_stmt.defines_one_name():
and parser_utils.for_stmt_defines_one_name(for_stmt):
# Iterate through result and add the values, that's possible
# only in for loops without clutter, because they are
# predictable. Also only do it, if the variable is not a tuple.
node = for_stmt.get_input_node()
node = for_stmt.get_testlist()
cn = ContextualizedNode(context, node)
ordered = list(iterable.py__iter__(self, cn.infer(), cn))