Author: mattip Branch: Changeset: r51363:ee1b4ea67ed9 Date: 2012-01-16 21:10 +0200 http://bitbucket.org/pypy/pypy/changeset/ee1b4ea67ed9/
Log: add failing test, add fix diff --git a/pypy/module/micronumpy/interp_iter.py b/pypy/module/micronumpy/interp_iter.py --- a/pypy/module/micronumpy/interp_iter.py +++ b/pypy/module/micronumpy/interp_iter.py @@ -157,6 +157,8 @@ offset += self.strides[i] break else: + if i == self.dim: + first_line = True indices[i] = 0 offset -= self.backstrides[i] else: 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 @@ -771,6 +771,8 @@ assert ((a + a).T.sum(2).T == (a + a).sum(0)).all() assert (a.reshape(1,-1).sum(0) == range(105)).all() assert (a.reshape(1,-1).sum(1) == 5460) + assert (array([[1,2],[3,4]]).prod(0) == [3, 8]).all() + assert (array([[1,2],[3,4]]).prod(1) == [2, 12]).all() def test_identity(self): from _numpypy import identity, array _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit