Currently it's possible to concatenate a type to a paramspec to get a new paramspec.
I think I may need the ability to concatenate two paramspecs, like:
P = ParamSpec('P')
Q = ParamSpec('Q')
R = TypeVar("R")
Callable[Concatenate[P, Q], R]
Pitch
I'm trying to describe partial-like functions, I spotted https://github.com/python/mypy/pull/16939 which solves if for functools.partial (which is good) but still not giving a way to describe other partial-like functions.
Currently I can successfully describe the "removal" of one or multiple parameters:
Feature
Currently it's possible to concatenate a type to a paramspec to get a new paramspec.
I think I may need the ability to concatenate two paramspecs, like:
Pitch
I'm trying to describe partial-like functions, I spotted https://github.com/python/mypy/pull/16939 which solves if for
functools.partial
(which is good) but still not giving a way to describe other partial-like functions.Currently I can successfully describe the "removal" of one or multiple parameters:
But what I think I need is:
I feel that would cleanly express the "removal" of
P
from[P, Q]
, without the need to introduce a new function likeDifference[P, Q]
.I feel like this could also be used for the real
functools.partial
, maybe simplifying the current (working, yeah) implementation.