1
0
forked from VimPlug/jedi

Separate class for Generator and List Comprehensions.

This commit is contained in:
Dave Halter
2014-11-12 13:28:31 +01:00
parent f760a7755d
commit 65f182ff0d
2 changed files with 22 additions and 15 deletions

View File

@@ -212,8 +212,8 @@ class Evaluator(object):
else:
c = atom.children
# Parentheses without commas are not tuples.
if c[0] == '(' and (not pr.is_node(c[1], 'testlist_comp')
or c[1].children[1] != ','):
if c[0] == '(' and not (pr.is_node(c[1], 'testlist_comp')
and len(c[1].children) > 1):
return self.eval_element(c[1])
try:
comp_for = c[1].children[1]
@@ -221,7 +221,7 @@ class Evaluator(object):
pass
else:
if isinstance(comp_for, pr.CompFor):
return [iterable.Comprehension(self, atom)]
return [iterable.Comprehension.from_atom(self, atom)]
return [iterable.Array(self, atom)]
def _eval_trailer(self, types, trailer):