From: Dag Sverre Seljebotn Date: Fri, 25 Sep 2009 07:45:24 +0000 (+0200) Subject: numpy.pxd: Old iteration method did not iterate dtype in order (fixes #371) X-Git-Tag: 0.11.3.rc0~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=12f3971ccc06e008a147a394452e7e48d42e23aa;p=cython.git numpy.pxd: Old iteration method did not iterate dtype in order (fixes #371) --- 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")