Author: mattip
Branch: matrixmath-reshape-merge
Changeset: r50093:7cf074391cf8
Date: 2011-12-03 18:39 +0200
http://bitbucket.org/pypy/pypy/changeset/7cf074391cf8/

Log:    Fix copy for slices

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
@@ -1282,9 +1282,11 @@
     def copy(self):
         array = NDimArray(self.size, self.shape[:], self.find_dtype())
         iter = self.start_iter()
+        a_iter = array.start_iter()
         while not iter.done():
-            array.setitem(iter.offset, self.getitem(iter.offset))
+            array.setitem(a_iter.offset, self.getitem(iter.offset))
             iter = iter.next(len(self.shape))
+            a_iter = a_iter.next(len(array.shape))
         return array
 
 class NDimArray(BaseArray):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to