1. nathanrice
  2. pypy

Commits

Maciej Fijalkowski  committed d6c604f

rebinding is a bit harmful for now. Let's not do it

  • Participants
  • Parent commits 1ff91b2
  • Branches numpy-back-to-applevel

Comments (0)

Files changed (2)

File lib_pypy/numpypy/core/_methods.py

View file
     rcount = mu.count_reduce_items(arr, axis=axis,
                             skipna=skipna, keepdims=True)
     if isinstance(arrmean, mu.ndarray):
-        arrmean = um.true_divide(arrmean, rcount,
-                            out=arrmean, casting='unsafe', subok=False)
+        arrmean2 = um.true_divide(arrmean, rcount,
+                                  casting='unsafe', subok=False)
     else:
-        arrmean = arrmean / float(rcount)
+        arrmean2 = arrmean / float(rcount)
 
     # arr - arrmean
-    x = arr - arrmean
+    x = arr - arrmean2
 
     # (arr - arrmean) ** 2
     if arr.dtype.kind == 'c':
-        x = um.multiply(x, um.conjugate(x), out=x).real
+        y = um.multiply(x, um.conjugate(x)).real
     else:
-        x = um.multiply(x, x, out=x)
+        y = um.multiply(x, x)
 
     # add.reduce((arr - arrmean) ** 2, axis)
-    ret = um.add.reduce(x, axis=axis, dtype=dtype, out=out,
-                                skipna=skipna, keepdims=keepdims)
+    ret = um.add.reduce(y, axis=axis, dtype=dtype, out=out,
+                        skipna=skipna, keepdims=keepdims)
 
     # add.reduce((arr - arrmean) ** 2, axis) / (n - ddof)
     if not keepdims and isinstance(rcount, mu.ndarray):

File pypy/module/micronumpy/interp_ufuncs.py

View file
 
     @unwrap_spec(skipna=bool, keepdims=bool)
     def descr_reduce(self, space, w_obj, w_axis=None, w_dtype=None,
-                     skipna=False, keepdims=True):
+                     skipna=False, keepdims=True, w_out=None):
         """reduce(...)
         reduce(a, axis=0)
 
         array([[ 1,  5],
                [ 9, 13]])
         """
+        if not space.is_w(w_out, space.w_None):
+            raise OperationError(space.w_NotImplementedError, space.wrap(
+                "out not supported"))
         if space.is_w(w_axis, space.w_None):
             axis = -1
         else: