How can I type hint that a value being returned by a function is both an NumPy array and holds NumPy float32 data?
I can specify that the returned value is an array using:
def func() -> np.ndarray:
...
However, this does not enforce the knowledge that it is a float32 array.
I can specify that the returned value is of type float32 using:
def func() -> np.float32:
...
However, this does not enforce the knowledge that it is an array (as opposed to a singular scalar value).
Is there a way I can get both specified in the return type?