Skip to content

Commit

Permalink
fix #16935 strike that: use tuple fallback as tuple[X,...] fallback
Browse files Browse the repository at this point in the history
... the original fallback ABCMeta is "correct" in that it aligns
with the (abstract) base class of builtins.tuple. But rather than
explicitly specify abc.ABCMeta as fallback, use the same
fallback as the type we're applying arguments to (and that is
abc.ABCMeta in our "tuple" case)
  • Loading branch information
urnest committed Jun 1, 2024
1 parent 7a39ef5 commit 5bd1c4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4844,9 +4844,9 @@ def apply_type_arguments_to_callable(
return CallableType(
[TupleType(list(args), self.chk.named_type("tuple"))],
[ARG_POS],
["p1"],
[None],
TupleType(list(args), self.chk.named_type("tuple")),
self.chk.named_type("builtins.type"),
tp.fallback,
name="tuple",
definition=tp.definition,
bound_args=tp.bound_args,
Expand Down

0 comments on commit 5bd1c4c

Please sign in to comment.