1
0
forked from VimPlug/jedi

Merge branch 'improve-type-annotation-inference' of https://github.com/PeterJCLaw/jedi

This commit is contained in:
Dave Halter
2020-04-01 00:54:13 +02:00
7 changed files with 890 additions and 51 deletions

View File

@@ -328,6 +328,11 @@ class SequenceLiteralValue(Sequence):
self.array_type = SequenceLiteralValue.mapping[atom.children[0]]
"""The builtin name of the array (list, set, tuple or dict)."""
def _get_generics(self):
if self.array_type == u'tuple':
return tuple(x.infer().py__class__() for x in self.py__iter__())
return super(SequenceLiteralValue, self)._get_generics()
def py__simple_getitem__(self, index):
"""Here the index is an int/str. Raises IndexError/KeyError."""
if isinstance(index, slice):