[pypy-commit] pypy default: #1034 -- added __rpow__ to numpy boxes
alex_gaynor
noreply at buildbot.pypy.org
Wed Feb 8 16:56:55 CET 2012
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch:
Changeset: r52242:5170d7047e5d
Date: 2012-02-08 10:56 -0500
http://bitbucket.org/pypy/pypy/changeset/5170d7047e5d/
Log: #1034 -- added __rpow__ to numpy boxes
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
@@ -92,6 +92,7 @@
descr_radd = _binop_right_impl("add")
descr_rsub = _binop_right_impl("subtract")
descr_rmul = _binop_right_impl("multiply")
+ descr_rpow = _binop_right_impl("power")
descr_neg = _unaryop_impl("negative")
descr_abs = _unaryop_impl("absolute")
@@ -181,6 +182,7 @@
__radd__ = interp2app(W_GenericBox.descr_radd),
__rsub__ = interp2app(W_GenericBox.descr_rsub),
__rmul__ = interp2app(W_GenericBox.descr_rmul),
+ __rpow__ = interp2app(W_GenericBox.descr_rpow),
__eq__ = interp2app(W_GenericBox.descr_eq),
__ne__ = interp2app(W_GenericBox.descr_ne),
diff --git a/pypy/module/micronumpy/test/test_dtypes.py b/pypy/module/micronumpy/test/test_dtypes.py
--- a/pypy/module/micronumpy/test/test_dtypes.py
+++ b/pypy/module/micronumpy/test/test_dtypes.py
@@ -407,3 +407,4 @@
from _numpypy import float64, int_
assert truediv(int_(3), int_(2)) == float64(1.5)
+ assert 2 ** int_(3) == int_(8)
More information about the pypy-commit
mailing list