Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion mypy/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ def too_many_arguments_from_typed_dict(
# Try to determine the name of the extra argument.
for key in arg_type.items:
if key not in callee.arg_names:
msg = f'Extra argument "{key}" from **args' + for_function(callee)
msg = f'Extra argument "{key}" from **TypedDict' + for_function(callee)
break
else:
self.too_many_arguments(callee, context)
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-functools.test
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,8 @@ def main4(a2good: A2Good, a2bad: A2Bad, **d2: Unpack[D2]) -> None:
partial(fn3, **d2)(**a2bad) # E: Argument "a2" to "fn3" has incompatible type "int"; expected "str"

def main5(**d2: Unpack[D2]) -> None:
partial(fn1, **d2)() # E: Extra argument "a2" from **args for "fn1"
partial(fn2, **d2)() # E: Extra argument "a2" from **args for "fn2"
partial(fn1, **d2)() # E: Extra argument "a2" from **TypedDict for "fn1"
partial(fn2, **d2)() # E: Extra argument "a2" from **TypedDict for "fn2"

def main6(a2good: A2Good, a2bad: A2Bad, **d1: Unpack[D1]) -> None:
partial(fn3, **d1)() # E: Missing positional argument "a1" in call to "fn3"
Expand Down
4 changes: 2 additions & 2 deletions test-data/unit/check-typeddict.test
Original file line number Diff line number Diff line change
Expand Up @@ -1835,9 +1835,9 @@ a: A
f1(**a)
f2(**a) # E: Argument "y" to "f2" has incompatible type "str"; expected "int"
f3(**a) # E: Argument "x" to "f3" has incompatible type "int"; expected "B"
f4(**a) # E: Extra argument "y" from **args for "f4"
f4(**a) # E: Extra argument "y" from **TypedDict for "f4"
f5(**a) # E: Missing positional arguments "y", "z" in call to "f5"
f6(**a) # E: Extra argument "y" from **args for "f6"
f6(**a) # E: Extra argument "y" from **TypedDict for "f6"
f1(1, **a) # E: "f1" gets multiple values for keyword argument "x"
[builtins fixtures/dict.pyi]
[typing fixtures/typing-typeddict.pyi]
Expand Down
2 changes: 1 addition & 1 deletion test-data/unit/check-typevar-tuple.test
Original file line number Diff line number Diff line change
Expand Up @@ -2251,7 +2251,7 @@ def test(
**kwargs: Unpack[Keywords],
) -> T:
if bool():
func(*args, **kwargs) # E: Extra argument "a" from **args
func(*args, **kwargs) # E: Extra argument "a" from **TypedDict
return func(*args)
def test2(
x: int,
Expand Down