how do I access the kind of the data from cython, i.e. the single
'i' (signed) integer
'u' unsigned integer
'c' complex-floating point
'O' (Python) objects
'S', 'a' (byte-)string
'V' raw data (void)
In regular Python I can do:
In : d = np.dtype('S')
In : d.kind
Looking at the definition of dtype that comes with cython, I see:
ctypedef class numpy.dtype [object PyArray_Descr]:
# Use PyDataType_* macros when possible, however there are no macros
# for accessing some of the fields, so some are defined. Please
# ask on cython-dev if you need more.
cdef int type_num
cdef int itemsize "elsize"
cdef char byteorder
cdef object fields
cdef tuple names
I.e. no kind.
Also, i looked for an appropriate PyDataType_* macro but couldn't find one.
Perhaps there is something simple I could use?