Author: mattip <matti.pi...@gmail.com> Branch: missing-ndarray-attributes Changeset: r60306:b345f036991d Date: 2013-01-21 20:16 +0200 http://bitbucket.org/pypy/pypy/changeset/b345f036991d/
Log: hack to make ztranslation pass 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 @@ -1015,6 +1015,14 @@ 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_ = () _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit