Skip to content

Commit 844826c

Browse files
committed
check fallback args
1 parent 9a776cf commit 844826c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

mypy/subtypes.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,9 @@ def visit_instance(self, left: Instance) -> bool:
470470
if mapped.type.tuple_type:
471471
expanded = expand_type_by_instance(mapped.type.tuple_type, mapped)
472472
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
473+
return self._is_subtype(
474+
expanded, right.copy_modified(fallback=expanded.partial_fallback)
475+
) and self._is_subtype(left, mypy.typeops.tuple_fallback(right))
478476
return False
479477
if isinstance(right, TypeVarTupleType):
480478
# tuple[Any, ...] is like Any in the world of tuples (see special case above).

0 commit comments

Comments
 (0)