1
0
forked from VimPlug/jedi

Support passing through values for non-annotated tuples

This commit is contained in:
Peter Law
2020-02-23 00:27:30 +00:00
parent 80db4dcf56
commit 5e990d9206
2 changed files with 26 additions and 0 deletions

View File

@@ -329,6 +329,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):