cython-devel
changeset 2141:eebbdf914ffd
numpy.pxd: Old iteration method did not iterate dtype in order (fixes #371)
| author | Dag Sverre Seljebotn <dagss@student.matnat.uio.no> |
|---|---|
| date | Fri Sep 25 09:45:24 2009 +0200 (3 years ago) |
| parents | 74a3e7971c1e |
| children | c02197764485 |
| files | Cython/Includes/numpy.pxd |
line diff
1.1 --- a/Cython/Includes/numpy.pxd Fri Sep 25 09:11:20 2009 +0200
1.2 +++ b/Cython/Includes/numpy.pxd Fri Sep 25 09:45:24 2009 +0200
1.3 @@ -124,7 +124,7 @@
1.4 cdef int itemsize "elsize"
1.5 cdef char byteorder
1.6 cdef object fields
1.7 - cdef object names
1.8 + cdef tuple names
1.9
1.10 ctypedef extern class numpy.flatiter [object PyArrayIterObject]:
1.11 # Use through macros
1.12 @@ -696,10 +696,11 @@
1.13 cdef tuple i
1.14 cdef int endian_detector = 1
1.15 cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
1.16 + cdef tuple fields
1.17
1.18 - for i in descr.fields.itervalues():
1.19 - child = i[0]
1.20 - new_offset = i[1]
1.21 + for childname in descr.names:
1.22 + fields = descr.fields[childname]
1.23 + child, new_offset = fields
1.24
1.25 if (end - f) - (new_offset - offset[0]) < 15:
1.26 raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")
