Many numpy functions take dtype arguments as either strings (like "float64") or numpy datatypes (like numpy.float64) or even python datatypes (like float).
I need to compare two datatypes and want to support this flexible interface. Is there a function under which all of these are forms are equivalent? I.e. I want the minimal function f such that
f("float64") == f(numpy.float64) == f(float)
What does numpy use internally?
You should read the Scalars page of the numpy documentation, which describes the data type hierarchy.
For comparing dtypes themselves, you can use np.issubdtype. Some examples: