We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9a776cf commit 844826cCopy full SHA for 844826c
mypy/subtypes.py
@@ -470,11 +470,9 @@ def visit_instance(self, left: Instance) -> bool:
470
if mapped.type.tuple_type:
471
expanded = expand_type_by_instance(mapped.type.tuple_type, mapped)
472
assert isinstance(expanded, TupleType)
473
- if self._is_subtype(
474
- expanded,
475
- right.copy_modified(fallback=expanded.partial_fallback)
476
- ):
477
- return not self.proper_subtype
+ return self._is_subtype(
+ expanded, right.copy_modified(fallback=expanded.partial_fallback)
+ ) and self._is_subtype(left, mypy.typeops.tuple_fallback(right))
478
return False
479
if isinstance(right, TypeVarTupleType):
480
# tuple[Any, ...] is like Any in the world of tuples (see special case above).
0 commit comments