Skip to content

Commit 75b09ac

Browse files
committed
Revert to previous version, only remove TODO
1 parent d3be613 commit 75b09ac

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

mypy/checker.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8484,6 +8484,10 @@ def visit_type_var(self, t: TypeVarType) -> bool:
84848484
# multi-step type inference.
84858485
return t.id.is_meta_var()
84868486

8487+
def visit_tuple_type(self, t: TupleType, /) -> bool:
8488+
# Exclude fallback to avoid bogus "need type annotation" errors
8489+
return self.query_types(t.items)
8490+
84878491

84888492
class SetNothingToAny(TypeTranslator):
84898493
"""Replace all ambiguous Uninhabited types with Any (to avoid spurious extra errors)."""

mypy/types.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2415,14 +2415,6 @@ def __init__(
24152415
implicit: bool = False,
24162416
) -> None:
24172417
super().__init__(line, column)
2418-
if fallback.type and fallback.type.fullname == "builtins.tuple":
2419-
# We actively ignore type argument for plain tuple fallback, to avoid spurious errors,
2420-
# partial_fallback should never be used directly anyway, only via typeops.tuple_fallback().
2421-
assert len(fallback.args) == 1
2422-
if not isinstance(fallback.args[0], ProperType) or not isinstance(
2423-
fallback.args[0], AnyType
2424-
):
2425-
fallback = fallback.copy_modified(args=[AnyType(TypeOfAny.special_form)])
24262418
self.partial_fallback = fallback
24272419
self.items = items
24282420
self.implicit = implicit

0 commit comments

Comments
 (0)