Commits

Brian Kearns  committed 11fec05

fix scalar any/all return types

  • Participants
  • Parent commits 3388d5c

Comments (0)

Files changed (2)

File pypy/module/micronumpy/interp_boxes.py

 
     def descr_any(self, space):
         value = space.is_true(self)
-        return space.wrap(W_BoolBox(value))
+        return self.get_dtype(space).box(value)
 
     def descr_all(self, space):
         value = space.is_true(self)
-        return space.wrap(W_BoolBox(value))
+        return self.get_dtype(space).box(value)
 
     def descr_ravel(self, space):
         from pypy.module.micronumpy.base import convert_to_array

File pypy/module/micronumpy/test/test_dtypes.py

         x = numpy.bool_(False)
         assert not x.any()
         assert not x.all()
-        #
+        assert isinstance(x.any(), numpy.bool_)
         x = numpy.float64(0)
         assert not x.any()
         assert not x.all()
-        assert isinstance(x.any(), numpy.bool_)
+        assert isinstance(x.any(), numpy.float64)
 
     def test_ravel(self):
         from numpypy import float64, int8, array