Skip to content

Commit 87cf7d5

Browse files
committed
Move partial_fallback higher up inheritance chain
1 parent fc2ab45 commit 87cf7d5

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

mypy/semanal_shared.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,6 @@ class HasPlaceholders(BoolTypeQuery):
364364
def __init__(self) -> None:
365365
super().__init__(ANY_STRATEGY)
366366

367-
def visit_tuple_type(self, t: TupleType, /) -> bool:
368-
return super().visit_tuple_type(t) or t.partial_fallback.accept(self)
369-
370367
def visit_placeholder_type(self, t: PlaceholderType) -> bool:
371368
return True
372369

mypy/type_visitor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def visit_callable_type(self, t: CallableType, /) -> T:
410410
return self.query_types(t.arg_types + [t.ret_type])
411411

412412
def visit_tuple_type(self, t: TupleType, /) -> T:
413-
return self.query_types(t.items)
413+
return self.query_types([t.partial_fallback] + t.items)
414414

415415
def visit_typeddict_type(self, t: TypedDictType, /) -> T:
416416
return self.query_types(t.items.values())
@@ -550,7 +550,7 @@ def visit_callable_type(self, t: CallableType, /) -> bool:
550550
return args and ret
551551

552552
def visit_tuple_type(self, t: TupleType, /) -> bool:
553-
return self.query_types(t.items)
553+
return self.query_types([t.partial_fallback] + t.items)
554554

555555
def visit_typeddict_type(self, t: TypedDictType, /) -> bool:
556556
return self.query_types(list(t.items.values()))

0 commit comments

Comments
 (0)