Consider the following function:
def test(data: np.ndarray, func, *args) -> np.ndarray:
return func(data, args)
The func and args arguments are numpy function and arguments corresponding to it. The question is, how do i annotate these two arguments with type hinting?
typing.Callable
springs to mind for the func
argument.
As for *args
- whilst it can be type hinted, I'd question the value of doing so. After all, it's an arbitrary set of positional arguments.
However, if you insist on doing so, then *args
is of type typing.Tuple