Assuming I have a C function I would like to wrap by the Nympy(Python)-C API to create a Python extension module. This module should be capable of accepting Numpy array that can have multiple types such as np.double, np.single, np.long, np.short etc.
What is the standard way to implement it? I assume that switch-case with a separate implementation for each of the types is not maintainable and there is a proper alternative