fix: clarify "Extra argument from **args" as "from **TypedDict" by nuglifeleoji · Pull Request #21127 · python/mypy
Fixes #20986.
When a TypedDict is unpacked with ** and contains keys the callee
does not accept, the error message was:
error: Extra argument "y" from **args for "func"
**args looks like a *args/**kwargs variable name, which is
confusing. Since this code path (too_many_arguments_from_typed_dict)
is only reached when the source is a TypedDict, the message is
updated to:
error: Extra argument "y" from **TypedDict for "func"
Changed mypy/messages.py and updated the four matching test fixtures
in test-data/unit/.
Made with Cursor