Bug Report
Passing list to a function which implements ParamSpec results in mypy throwing Too many arguments when trying to use the result.
To Reproduce
Example:
from typing import Callable, TypeVar
from typing_extensions import ParamSpec
P = ParamSpec('P')
R = TypeVar('R')
def wrapper(func: Callable[P, R]) -> Callable[P, R]:
return func
wrapper(list)([1, 2, 3]) # "Too many arguments"
Expected Behavior
mypy should treat wrapper(list) exactly the same as list in this case.
Actual Behavior
"Too many arguments" is thrown when using the result of wrapper(list)
Your Environment
- Mypy version used: 0.950
- Mypy command-line flags:
- Mypy configuration options from
mypy.ini (and other config files): follow_imports = silent, ignore_missing_imports = True, strict = True
- Python version used: 3.10.4
- Operating system and version: Debian bullseye
Bug Report
Passing
listto a function which implements ParamSpec results in mypy throwingToo many argumentswhen trying to use the result.To Reproduce
Example:
Expected Behavior
mypy should treat
wrapper(list)exactly the same aslistin this case.Actual Behavior
"Too many arguments" is thrown when using the result of
wrapper(list)Your Environment
mypy.ini(and other config files): follow_imports = silent, ignore_missing_imports = True, strict = True