1
0
forked from VimPlug/jedi

Fix the first issues with the new typing module implementation

This commit is contained in:
Dave Halter
2018-08-21 01:28:55 +02:00
parent 6ddc242746
commit 9fe9bed1c9
6 changed files with 52 additions and 38 deletions

View File

@@ -273,6 +273,7 @@ class GeneratorComprehension(ComprehensionMixin, GeneratorBase):
class SequenceLiteralContext(Sequence):
_TUPLE_LIKE = 'testlist_star_expr', 'testlist', 'subscriptlist'
mapping = {'(': u'tuple',
'[': u'list',
'{': u'set'}
@@ -282,7 +283,7 @@ class SequenceLiteralContext(Sequence):
self.atom = atom
self._defining_context = defining_context
if self.atom.type in ('testlist_star_expr', 'testlist'):
if self.atom.type in self._TUPLE_LIKE:
self.array_type = u'tuple'
else:
self.array_type = SequenceLiteralContext.mapping[atom.children[0]]
@@ -336,7 +337,7 @@ class SequenceLiteralContext(Sequence):
def _items(self):
c = self.atom.children
if self.atom.type in ('testlist_star_expr', 'testlist'):
if self.atom.type in self._TUPLE_LIKE:
return c[::2]
array_node = c[1]