Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type aliases with fixed-length tuples #14184

Merged
merged 7 commits into from
Nov 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Extract fix from #14181
  • Loading branch information
JukkaL committed Nov 25, 2022
commit 2a1ab2d16d207987b7a6bd4bde64b7a3a112582f
2 changes: 2 additions & 0 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
@@ -3968,6 +3968,8 @@ def apply_type_arguments_to_callable(
tp = get_proper_type(tp)

if isinstance(tp, CallableType):
if tp.is_type_obj() and tp.type_object().fullname == "builtins.tuple":
return tp
if len(tp.variables) != len(args):
self.msg.incompatible_type_application(len(tp.variables), len(args), ctx)
return AnyType(TypeOfAny.from_error)