Author: Alex Gaynor <[email protected]>
Branch: numpy-dtype-refactor
Changeset: r49552:93b855d2ce60
Date: 2011-11-19 13:21 -0500
http://bitbucket.org/pypy/pypy/changeset/93b855d2ce60/
Log: running all tests together now passes
diff --git a/pypy/module/micronumpy/interp_ufuncs.py
b/pypy/module/micronumpy/interp_ufuncs.py
--- a/pypy/module/micronumpy/interp_ufuncs.py
+++ b/pypy/module/micronumpy/interp_ufuncs.py
@@ -270,11 +270,11 @@
def impl(res_dtype, value):
return getattr(res_dtype.itemtype, op_name)(value)
elif argcount == 2:
+ dtype_cache = interp_dtype.get_dtype_cache(space)
def impl(res_dtype, lvalue, rvalue):
res = getattr(res_dtype.itemtype, op_name)(lvalue, rvalue)
if comparison_func:
- bool_dtype = interp_dtype.get_dtype_cache(space).w_booldtype
- res = bool_dtype.box(res)
+ return dtype_cache.w_booldtype.box(res)
return res
return func_with_new_name(impl, ufunc_name)
diff --git a/pypy/module/micronumpy/test/test_zjit.py
b/pypy/module/micronumpy/test/test_zjit.py
--- a/pypy/module/micronumpy/test/test_zjit.py
+++ b/pypy/module/micronumpy/test/test_zjit.py
@@ -200,7 +200,9 @@
])
s = SingleDimSlice(0, step*i, step, i, ar, new_sig)
v = interp_ufuncs.get(self.space).add.call(self.space, [s, s])
- return v.get_concrete().eval(3).value
+ v = v.get_concrete().eval(3)
+ assert isinstance(v, interp_boxes.W_Float64Box)
+ return v.value
result = self.meta_interp(f, [5], listops=True, backendopt=True)
self.check_loops({'int_mul': 1, 'getinteriorfield_raw': 2,
'float_add': 1,
@@ -222,7 +224,9 @@
])
s2 = SingleDimSlice(0, step2*i, step2, i, ar, new_sig)
v = interp_ufuncs.get(self.space).add.call(self.space, [s1, s2])
- return v.get_concrete().eval(3).value
+ v = v.get_concrete().eval(3)
+ assert isinstance(v, interp_boxes.W_Float64Box)
+ return v.value
result = self.meta_interp(f, [5], listops=True, backendopt=True)
self.check_loops({'int_mul': 2, 'getinteriorfield_raw': 2,
'float_add': 1,
@@ -241,7 +245,9 @@
ar2.get_concrete().setitem(1, float64_dtype.box(5.5))
arg = ar2.descr_add(space, ar2)
ar.setslice(space, 0, step*i, step, i, arg)
- return ar.get_concrete().eval(3).value
+ v = ar.get_concrete().eval(3)
+ assert isinstance(v, interp_boxes.W_Float64Box)
+ return v.value
result = self.meta_interp(f, [5], listops=True, backendopt=True)
self.check_loops({'getinteriorfield_raw': 2,
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit