Bug Report
A function that takes in a function with a broad signature and returns a narrowed partially-applied function now reports error: Too few arguments [call-arg] in mypy 1.12.
To Reproduce
from functools import partial
from typing import ParamSpec, TypeVar, Callable, Concatenate
P = ParamSpec("P")
R = TypeVar("R")
def partializer(
func: Callable[Concatenate[int, str, P], R],
one: int,
two: str,
) -> Callable[P, R]:
return partial(func, one, two)
Live playground link
Expected Behavior
mypy has not reported any issue with this incantation historically, and should still not report on (what, as far as my understanding allows, is) valid code.
Actual Behavior
main.py:12: error: Too few arguments [call-arg]
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 1.12
- Mypy command-line flags: N/A
- Mypy configuration options from
mypy.ini (and other config files): N/A
- Python version used: 3.9, 3.11, 3.12
Bug Report
A function that takes in a function with a broad signature and returns a narrowed partially-applied function now reports
error: Too few arguments [call-arg]in mypy 1.12.To Reproduce
Live playground link
Expected Behavior
mypy has not reported any issue with this incantation historically, and should still not report on (what, as far as my understanding allows, is) valid code.
Actual Behavior
Your Environment
mypy.ini(and other config files): N/A