Skip to content

Commit

Permalink
check fallback args
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Sep 15, 2023
1 parent 9a776cf commit 844826c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions mypy/subtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,9 @@ def visit_instance(self, left: Instance) -> bool:
if mapped.type.tuple_type:
expanded = expand_type_by_instance(mapped.type.tuple_type, mapped)
assert isinstance(expanded, TupleType)
if self._is_subtype(
expanded,
right.copy_modified(fallback=expanded.partial_fallback)
):
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))
return False
if isinstance(right, TypeVarTupleType):
# tuple[Any, ...] is like Any in the world of tuples (see special case above).
Expand Down

0 comments on commit 844826c

Please sign in to comment.