1
0
forked from VimPlug/jedi

Add handling of nested generic tuples

This commit is contained in:
Peter Law
2020-04-19 14:10:03 +01:00
parent a793dd7c91
commit cfa01d3ac5
3 changed files with 51 additions and 2 deletions

View File

@@ -327,6 +327,9 @@ class Tuple(BaseTypingValueWithGenerics):
from jedi.inference.gradual.annotation import merge_pairwise_generics, merge_type_var_dicts
from jedi.inference.gradual.base import GenericClass
if is_class_value:
value_set = value_set.execute_annotation()
if self._is_homogenous():
# The parameter annotation is of the form `Tuple[T, ...]`,
# so we treat the incoming tuple like a iterable sequence
@@ -343,8 +346,12 @@ class Tuple(BaseTypingValueWithGenerics):
type_var_dict = {}
for element in value_set:
py_class = element.get_annotated_class_object()
if not isinstance(py_class, GenericClass):
if not is_class_value:
py_class = element.get_annotated_class_object()
if not isinstance(py_class, GenericClass):
py_class = element
else:
py_class = element
merge_type_var_dicts(