24 Sep
2020
24 Sep
'20
4:29 p.m.
Have you checked out [PEP 612](https://www.python.org/dev/peps/pep-0612/)? It defines `ParamSpec` and `Concatenate`. The return type can already be handled through `Callable` TypeVar matching. Does that combination of functionality satisfy the use cases you have in mind? PEP 612 is a Python 3.10 feature, but it is already implemented in Pyright if you want to give it a try. A more general `Parameters` mechanism is complicated in Python because of named parameters, which are not supported in TypeScript. In TypeScript, the `Parameters` utility function returns a tuple with each entry corresponding to a parameter position. It's not clear what an analogous mechanism would return in Python.