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.
This commit is contained in:
Peter Law
2020-02-22 23:13:31 +00:00
parent c15e0ef9b8
commit e557129121

View File

@@ -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(