Author: Maciej Fijalkowski <[email protected]>
Branch:
Changeset: r58451:6a45075e5fba
Date: 2012-10-26 13:28 +0200
http://bitbucket.org/pypy/pypy/changeset/6a45075e5fba/
Log: merge
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -433,9 +433,7 @@
def _binop_right_impl(ufunc_name):
def impl(self, space, w_other, w_out=None):
- dtype = interp_ufuncs.find_dtype_for_scalar(space, w_other,
- self.get_dtype())
- w_other = W_NDimArray.new_scalar(space, dtype, w_other)
+ w_other = convert_to_array(space, w_other)
return getattr(interp_ufuncs.get(space), ufunc_name).call(space,
[w_other, self, w_out])
return func_with_new_name(impl, "binop_right_%s_impl" % ufunc_name)
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
@@ -694,6 +694,8 @@
r = 3 + array(range(3))
for i in range(3):
assert r[i] == i + 3
+ r = [1, 2] + array([1, 2])
+ assert (r == [2, 4]).all()
def test_add_list(self):
from _numpypy import array, ndarray
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit