1
0
forked from VimPlug/jedi

Progress with list comprehensions. There is now a separate class.

This commit is contained in:
Dave Halter
2014-11-12 11:42:31 +01:00
parent cc661473bc
commit 54c5591ccb
4 changed files with 38 additions and 2 deletions

View File

@@ -211,6 +211,13 @@ class Evaluator(object):
if c[0] == '(' and (not pr.is_node(c[1], 'testlist_comp')
or c[1].children[1] != ','):
return self.eval_element(c[1])
try:
comp_for = c[1].children[1]
except (IndexError, AttributeError):
pass
else:
if isinstance(comp_for, pr.CompFor):
return [iterable.Comprehension(self, atom)]
return [iterable.Array(self, atom)]
def _eval_trailer(self, types, trailer):