Author: Ronan Lamy <ronan.l...@gmail.com> Branch: longdouble2 Changeset: r62900:86a3422134f7 Date: 2013-03-31 00:38 +0000 http://bitbucket.org/pypy/pypy/changeset/86a3422134f7/
Log: fix translation oddity with .read_bool() diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py --- a/pypy/module/micronumpy/types.py +++ b/pypy/module/micronumpy/types.py @@ -682,6 +682,7 @@ rfloat.DTSF_STR_PRECISION) @staticmethod + @specialize.argtype(0) def for_computation(v): return float(v) @@ -992,20 +993,10 @@ class NonNativeFloat32(BaseType, NonNativeFloat): _attrs_ = () - - T = rffi.FLOAT spec = float32_spec BoxType = interp_boxes.W_Float32Box format_code = "f" - def read_bool(self, arr, i, offset): - # it's not clear to me why this is needed - # but a hint might be that calling for_computation(v) - # causes translation to fail, and the assert is necessary - v = self._read(arr.storage, i, offset) - assert isinstance(v, float) - return bool(v) - class Float64(BaseType, Float): _attrs_ = () spec = float64_spec _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit