# [pypy-commit] pypy numpy-back-to-applevel: a test and a fix

fijal noreply at buildbot.pypy.org
Thu Jan 26 20:59:34 CET 2012

```Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: numpy-back-to-applevel
Changeset: r51810:48f4c0d75310
Date: 2012-01-26 21:59 +0200
http://bitbucket.org/pypy/pypy/changeset/48f4c0d75310/

Log:	a test and a fix

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
@@ -511,7 +511,7 @@
for nd in range(ndims):
new_backstrides[nd] = (new_shape[nd] - 1) * new_strides[nd]
arr = W_NDimSlice(concrete.start, new_strides, new_backstrides,
-                              new_shape, self)
+                              new_shape, concrete)
else:
# Create copy with contiguous data
arr = concrete.copy(space)
diff --git a/pypy/module/micronumpy/test/test_numarray.py b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -425,6 +425,7 @@
assert (a == [1000, 1, 2, 3, 1000, 5, 6, 7, 1000, 9, 10, 11]).all()
a = zeros((4, 2, 3))
a.shape = (12, 2)
+        (a + a).reshape(2, 12) # assert did not explode

def test_slice_reshape(self):
from _numpypy import zeros, arange
```

More information about the pypy-commit mailing list