Commit c8f968f8 authored by John Kirkham's avatar John Kirkham

Add `typeobj` to `dtype`

Allows users to get the underlying `typeobj` (e.g. `numpy.float64`) from
the `dtype`.
parent cffb63d3
......@@ -19,7 +19,7 @@ DEF _buffer_format_string_len = 255
cimport cpython.buffer as pybuf
from cpython.ref cimport Py_INCREF, Py_XDECREF
from cpython.mem cimport PyObject_Malloc, PyObject_Free
from cpython.object cimport PyObject
from cpython.object cimport PyObject, PyTypeObject
from cpython.type cimport type
cimport libc.stdio as stdio
......@@ -164,6 +164,7 @@ cdef extern from "numpy/arrayobject.h":
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.
cdef PyTypeObject* typeobj;
cdef char kind
cdef char type
# Numpy sometimes mutates this without warning (e.g. it'll
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment