From 12f3971ccc06e008a147a394452e7e48d42e23aa Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Fri, 25 Sep 2009 09:45:24 +0200 Subject: [PATCH] numpy.pxd: Old iteration method did not iterate dtype in order (fixes #371) --- Cython/Includes/numpy.pxd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Cython/Includes/numpy.pxd b/Cython/Includes/numpy.pxd index 3fb343d8..cb766f63 100644 --- a/Cython/Includes/numpy.pxd +++ b/Cython/Includes/numpy.pxd @@ -124,7 +124,7 @@ cdef extern from "numpy/arrayobject.h": cdef int itemsize "elsize" cdef char byteorder cdef object fields - cdef object names + cdef tuple names ctypedef extern class numpy.flatiter [object PyArrayIterObject]: # Use through macros @@ -696,10 +696,11 @@ cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset cdef tuple i cdef int endian_detector = 1 cdef bint little_endian = ((&endian_detector)[0] != 0) + cdef tuple fields - for i in descr.fields.itervalues(): - child = i[0] - new_offset = i[1] + for childname in descr.names: + fields = descr.fields[childname] + child, new_offset = fields if (end - f) - (new_offset - offset[0]) < 15: raise RuntimeError("Format string allocated too short, see comment in numpy.pxd") -- 2.26.2