[pypy-commit] pypy numpy-dtype-alt: str(<bool>) in RPython doesn't do what I expected. Fixed.

alex_gaynor noreply at buildbot.pypy.org
Sat Aug 20 04:57:18 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-alt
Changeset: r46651:be4f3a24926d
Date: 2011-08-19 22:01 -0500
http://bitbucket.org/pypy/pypy/changeset/be4f3a24926d/

Log:	str(<bool>) in RPython doesn't do what I expected. Fixed.

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
@@ -229,7 +229,8 @@
         return self.adapt_val(space.is_true(w_item))
 
     def str_format(self, item):
-        return str(self.unbox(item))
+        v = self.unbox(item)
+        return "True" if v else "False"
 
     @binop
     def add(self, v1, v2):


More information about the pypy-commit mailing list