Commits

Brian Kearns  committed 819adf9

fix subtypes of numpy scalars

  • Participants
  • Parent commits b63fad1

Comments (0)

Files changed (2)

File pypy/module/micronumpy/interp_numarray.py

                                                   w_base=w_buffer,
                                                   writable=buf.is_writable())
 
-    if not shape:
-        return W_NDimArray.new_scalar(space, dtype)
     order = order_converter(space, w_order, NPY_CORDER)
     if order == NPY_CORDER:
         order = 'C'

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

                 self = ndarray.__new__(subtype, shape, dtype)
                 self.id = 'subtype'
                 return self
+        a = C((), int)
+        assert type(a) is C
+        assert a.shape == ()
+        assert a.dtype is dtype(int)
+        assert a.id == 'subtype'
         a = C([2, 2], int)
         assert isinstance(a, C)
         assert isinstance(a, ndarray)