Is there a way to have a TypeVar (or some other format) capture all the arguments of a function? For example, say I want to wrap a general function, such that all its arguments are given within a tuple:
def invoke(f: Callable[..., T], args: Tuple[...]) -> T:
return f(*args)
Only that instead of the ellipsis (...), I'll have the static-type inspection enforce the contents of the Tuple to be have the same types as the function's arguments.
Thanks.