[pypy-commit] pypy numppy-flatitter: need to rethink getitem, setitem

mattip noreply at buildbot.pypy.org
Sun Jan 22 00:51:43 CET 2012


Author: mattip
Branch: numppy-flatitter
Changeset: r51619:aa7917ad8e16
Date: 2012-01-21 23:14 +0200
http://bitbucket.org/pypy/pypy/changeset/aa7917ad8e16/

Log:	need to rethink getitem, setitem

diff --git a/pypy/module/micronumpy/interp_numarray.py b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -1299,10 +1299,13 @@
         size = 1
         for sh in arr.shape:
             size *= sh
-        if arr.strides[-1] < arr.strides[0]:
+        if arr.strides[-1] <= arr.strides[0]:
             self.strides = [arr.strides[-1]]
             self.backstrides = [arr.backstrides[-1]]
         else:
+            XXX
+            # This will not work: getitem and setitem will
+            # fail. Need to be smarter: calculate the indices from the int
             self.strides = [arr.strides[0]]
             self.backstrides = [arr.backstrides[0]]
         ViewArray.__init__(self, size, [size], arr.dtype, order=arr.order,


More information about the pypy-commit mailing list