Author: Ilya Osadchiy <[email protected]>
Branch: numpy-comparison
Changeset: r47017:b151eb30e871
Date: 2011-09-02 13:51 +0300
http://bitbucket.org/pypy/pypy/changeset/b151eb30e871/
Log: Translation fix
diff --git a/pypy/module/micronumpy/interp_dtype.py
b/pypy/module/micronumpy/interp_dtype.py
--- a/pypy/module/micronumpy/interp_dtype.py
+++ b/pypy/module/micronumpy/interp_dtype.py
@@ -132,10 +132,10 @@
def bool_binop(func):
@functools.wraps(func)
def impl(self, v1, v2):
- return self.box(func(self,
+ return self.box(bool(func(self,
self.for_computation(self.unbox(v1)),
self.for_computation(self.unbox(v2)),
- ))
+ )))
return impl
def unaryop(func):
@@ -198,8 +198,8 @@
def bool(self, v):
return bool(self.for_computation(self.unbox(v)))
-# def ne(self, v1, v2):
-# return self.for_computation(self.unbox(v1)) !=
self.for_computation(self.unbox(v2))
+ def ne_w(self, v1, v2):
+ return self.for_computation(self.unbox(v1)) !=
self.for_computation(self.unbox(v2))
class FloatArithmeticDtype(ArithmaticTypeMixin):
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
@@ -121,7 +121,7 @@
size=size, i=i, result=result,
cur_best=cur_best)
new_best = getattr(dtype, op_name)(cur_best, self.eval(i))
- if dtype.unbox(dtype.ne(new_best, cur_best)):
+ if dtype.ne_w(new_best, cur_best):
result = i
cur_best = new_best
i += 1
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit