Commits

Brian Kearns  committed e028990

fix base after __array__

  • Participants
  • Parent commits ff3d519

Comments (0)

Files changed (2)

File pypy/module/micronumpy/interp_numarray.py

         if type(self) is W_NDimArray:
             return self
         return W_NDimArray.from_shape_and_storage(
-            space, self.get_shape(), self.implementation.storage, self.get_dtype())
+            space, self.get_shape(), self.implementation.storage,
+            self.get_dtype(), w_base=self)
 
     def descr_array_iface(self, space):
         addr = self.implementation.get_storage_as_int(space)

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

 
         assert type(a) is not ndarray
         assert a[0,0] == 100
+        assert a.base is not None
         b = a.__array__()
         assert type(b) is ndarray
         assert b[0,0] == 100
+        assert b.base is a
 
     def test_subtype_view(self):
         from numpypy import ndarray, array