Open
Description
Currently, functools.partial's __call__
method takes *args: Any, **kwargs: Any
and returns _T
(a TypeVar for the return type of the callable the partial is wrapping). This is decent, but matching the parameter typing would make this more useful in more situations.
I can sort of see how to deal with this, although I'll admit I'm unsure how to make this generically work. I imagine you could probably deal with some number of Concatenate
s (maybe up to 5 or 10) to deal with most cases. It's possible fixing this requires another PEP to allow an arbitrary-length Concatenate
-type pattern.
Related to python/mypy#1484