-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-overloadstopic-paramspecPEP 612, ParamSpec, ConcatenatePEP 612, ParamSpec, Concatenate
Description
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
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-overloadstopic-paramspecPEP 612, ParamSpec, ConcatenatePEP 612, ParamSpec, Concatenate