-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Please consider example from PEP-612
from typing import Concatenate, Callable, TypeVar, ParamSpec
R = TypeVar('R')
P = ParamSpec('P')
class Request:
pass
def with_request(f: Callable[Concatenate[Request, P], R]) -> Callable[P, R]:
def inner(*args: P.args, **kwargs: P.kwargs) -> R:
return f(Request(), *args, **kwargs)
return inner
then
$ mypy t6.py
t6.py:9: error: The first argument to Callable must be a list of types or "..."
Found 1 error in 1 file (checked 1 source file)
I would expect Concatenate
to be accepted as the first argument of Callable.
Mypy 0.930, Python 3.10.1
Molkree, bloussou, regisb, SubaruArai, MaddyGuthridge and 4 more