[pypy-commit] pypy numpypy-array_prepare_-array_wrap: sum doesn't exist in numpypy

rguillebert noreply at buildbot.pypy.org
Tue Nov 19 21:09:07 CET 2013


Author: Romain Guillebert <romain.py at gmail.com>
Branch: numpypy-array_prepare_-array_wrap
Changeset: r68248:b5c80215f7e5
Date: 2013-11-19 21:08 +0100
http://bitbucket.org/pypy/pypy/changeset/b5c80215f7e5/

Log:	sum doesn't exist in numpypy

diff --git a/pypy/module/micronumpy/test/test_subtype.py b/pypy/module/micronumpy/test/test_subtype.py
--- a/pypy/module/micronumpy/test/test_subtype.py
+++ b/pypy/module/micronumpy/test/test_subtype.py
@@ -374,7 +374,7 @@
         raises(TypeError, log, a, out=c)
 
     def test___array_prepare__reduce(self):
-        from numpypy import ndarray, array, sum, ones, add
+        from numpypy import ndarray, array, ones, add
         class with_prepare(ndarray):
             def __array_prepare__(self, arr, context):
                 x = array(arr).view(type=with_prepare)
@@ -382,7 +382,7 @@
                 print 'called_prepare',arr
                 return x
         a = ones(2).view(type=with_prepare)
-        x = sum(a)
+        x = a.sum()
         assert type(x) == with_prepare
         assert x.shape == ()
         # reduce functions do not call prepare, is this a numpy 'feature'?
@@ -391,6 +391,6 @@
         assert type(x) == with_prepare
         assert not getattr(x, 'called_prepare',False)
         a = ones((2,3)).view(type=with_prepare)
-        x = sum(a, axis=0)
+        x = a.sum(axis=0)
         assert type(x) == with_prepare
         assert not getattr(x, 'called_prepare',False)


More information about the pypy-commit mailing list