[pypy-commit] pypy default: allow (unsupported) out arg for scalar.round

bdkearns noreply at buildbot.pypy.org
Thu Nov 14 02:04:59 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r68007:bb54a2f34c40
Date: 2013-11-13 19:33 -0500
http://bitbucket.org/pypy/pypy/changeset/bb54a2f34c40/

Log:	allow (unsupported) out arg for scalar.round

diff --git a/pypy/module/micronumpy/interp_boxes.py b/pypy/module/micronumpy/interp_boxes.py
--- a/pypy/module/micronumpy/interp_boxes.py
+++ b/pypy/module/micronumpy/interp_boxes.py
@@ -255,7 +255,10 @@
         return convert_to_array(space, w_values)
 
     @unwrap_spec(decimals=int)
-    def descr_round(self, space, decimals=0):
+    def descr_round(self, space, decimals=0, w_out=None):
+        if not space.is_none(w_out):
+            raise OperationError(space.w_NotImplementedError, space.wrap(
+                "out not supported"))
         v = self.convert_to(self.get_dtype(space))
         return self.get_dtype(space).itemtype.round(v, decimals)
 
diff --git a/pypy/module/micronumpy/test/test_scalar.py b/pypy/module/micronumpy/test/test_scalar.py
--- a/pypy/module/micronumpy/test/test_scalar.py
+++ b/pypy/module/micronumpy/test/test_scalar.py
@@ -53,6 +53,7 @@
         assert f.round() == 13.
         assert f.round(decimals=-1) == 10.
         assert f.round(decimals=1) == 13.4
+        assert f.round(decimals=1, out=None) == 13.4
         assert b.round() == 1.0
         assert b.round(decimals=5) is b
 


More information about the pypy-commit mailing list