From e55712912144ff89842f8a5b44c54d6a28ce70d4 Mon Sep 17 00:00:00 2001 From: Peter Law Date: Sat, 22 Feb 2020 23:13:31 +0000 Subject: [PATCH] Remove check which doesn't seem to be needed I'm not sure why I added this, though removing it doesn't seem to casue any issues. I suspect there might be some oddness if the type being passed in doesn't match the type expected, though them having the same number of generic paramters isn't an expecially great way to validate that. --- jedi/inference/gradual/annotation.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/jedi/inference/gradual/annotation.py b/jedi/inference/gradual/annotation.py index 2a9e3d73..7efff3cd 100644 --- a/jedi/inference/gradual/annotation.py +++ b/jedi/inference/gradual/annotation.py @@ -447,12 +447,6 @@ def _infer_type_vars(annotation_value, value_set, is_class_value=False): annotation_generics = annotation_value.get_generics() actual_generics = klass.get_generics() - if len(annotation_generics) != len(actual_generics): - # TODO: might there be other matches elsewhere in the MRO? - # TODO: what happens if _some_ of the generics are realised at - # this point, but not all (e.g: class `Foo(Dict[str, T])`)? - break - for annotation_generics_set, actual_generic_set in zip(annotation_generics, actual_generics): for nested_annotation_value in annotation_generics_set: _merge_type_var_dicts(