Skip to content

Commit 63995e3

Browse files
committed
Tidy up code a bit
1 parent a32ad3f commit 63995e3

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

mypy/checkexpr.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,10 +2331,9 @@ def check_argument_count(
23312331
# Positional argument when expecting a keyword argument.
23322332
self.msg.too_many_positional_arguments(callee, context)
23332333
ok = False
2334-
elif callee.param_spec() is not None:
2335-
if not formal_to_actual[i]:
2336-
self.msg.too_few_arguments(callee, context, actual_names)
2337-
ok = False
2334+
elif callee.param_spec() is not None and not formal_to_actual[i]:
2335+
self.msg.too_few_arguments(callee, context, actual_names)
2336+
ok = False
23382337
return ok
23392338

23402339
def check_for_extra_actual_arguments(

test-data/unit/check-parameter-specification.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2283,8 +2283,8 @@ def foo(s: str, s2: str) -> None: ...
22832283
[builtins fixtures/paramspec.pyi]
22842284

22852285
[case testRunParamSpecOverload]
2286-
from typing_extensions import ParamSpec, Concatenate
2287-
from typing import Callable, overload, NoReturn, TypeVar, Union
2286+
from typing_extensions import ParamSpec
2287+
from typing import Callable, NoReturn, TypeVar, Union, overload
22882288

22892289
P = ParamSpec("P")
22902290
T = TypeVar("T")

0 commit comments

Comments
 (0)