On 2011-07-28 07:50, Johan Råde wrote:
> How do I get the PyTypeObject* for a NumPy scalar type such as np.uint8?
>
> (The reason I'm asking is the following:
> I'm writing a C++ extension module. The Python interface to the module
> has a function f that takes a NumPy scalar type as an argument, for
> instance f(np.uint8). Then the corresponding C++ function receives a
> PyObject* and needs to decide which type object it points to.)
>
> --Johan
I have figured out the answer:
PyArray_TypeObjectFromType(NPY_UINT8)
--Johan
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion