Commits

Antonio Cuni committed 260f7bc

implement ravel() for numpy types

  • Participants
  • Parent commits 938e96a

Comments (0)

Files changed (1)

File pypy/module/micronumpy/interp_boxes.py

         value = space.is_true(self)
         return space.wrap(W_BoolBox(value))
 
+    def descr_ravel(self, space):
+        from pypy.module.micronumpy.base import convert_to_array
+        w_values = space.newtuple([self])
+        return convert_to_array(space, w_values)
+
 class W_BoolBox(W_GenericBox, PrimitiveBox):
     descr__new__, _get_dtype = new_dtype_getter("bool")
 
     tolist = interp2app(W_GenericBox.item),
     any = interp2app(W_GenericBox.descr_any),
     all = interp2app(W_GenericBox.descr_all),
+    ravel = interp2app(W_GenericBox.descr_ravel),
 )
 
 W_BoolBox.typedef = TypeDef("bool_", W_GenericBox.typedef,