1
0
forked from VimPlug/jedi

Parentheses without commas are no tuples.

This commit is contained in:
Dave Halter
2014-10-22 02:10:48 +02:00
parent 6a8b840b29
commit 297bcf6e19

View File

@@ -212,7 +212,12 @@ class Evaluator(object):
mapping = {'(': pr.Array.TUPLE,
'[': pr.Array.LIST,
'{': pr.Array.DICT}
return [iterable.Array(self, atom.children[1], mapping[atom.children[0]])]
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] != ','):
return self.eval_element(c[1])
return [iterable.Array(self, c[1], mapping[c[0]])]
def _eval_trailer(self, types, trailer):
trailer_op, node = trailer.children[:2]