[Numpy-discussion] C-API: PyTypeObject* for NumPy scalar types

Johan Råde johan.rade at gmail.com
Thu Jul 28 01:50:05 EDT 2011


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




More information about the NumPy-Discussion mailing list