Skip to content
Merged
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 @@ -575,7 +575,7 @@ def too_few_arguments(self, callee: CallableType, context: Context,
msg = 'Missing positional argument'
else:
msg = 'Missing positional arguments'
if callee.name and diff:
if callee.name and diff and all(d is not None for d in diff):
msg += ' "{}" in call to {}'.format('", "'.join(diff), callee.name)
else:
msg = 'Too few arguments'
Expand Down
5 changes: 5 additions & 0 deletions test-data/unit/check-functions.test
Original file line number Diff line number Diff line change
Expand Up @@ -2039,3 +2039,8 @@ l: List[int] = make_list()

bad = make_list() # E: Need type annotation for variable
[builtins fixtures/list.pyi]

[case testAnonymousArgumentError]
def foo(__b: int, x: int, y: int) -> int: pass
foo(x=2, y=2) # E: Missing positional argument
foo(y=2) # E: Missing positional arguments