-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongpriority-2-lowtopic-paramspecPEP 612, ParamSpec, ConcatenatePEP 612, ParamSpec, Concatenate
Description
Bug Report
To Reproduce
from typing import Callable, ParamSpec, TypeVar
T = TypeVar("T")
P = ParamSpec("P")
R = TypeVar("R")
def call(f: Callable[P, R], *args: P.args, **kwargs: P.kwargs) -> R:
return f(*args, **kwargs)
def identity(x: T) -> T:
return x
call(identity, 2) # error: Argument 2 to "call" has incompatible type "int"; expected "T"
y: int = call(identity, 2) # error: Incompatible types in assignment (expression has type "T", variable has type "int")
Expected Behavior
Code passes type checking.
Actual Behavior
Mypy emits errors.
Your Environment
- Mypy version used: 0.931
- Python version used: 3.10
Kludex
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongpriority-2-lowtopic-paramspecPEP 612, ParamSpec, ConcatenatePEP 612, ParamSpec, Concatenate