Commits

Brian Kearns committed 1606b57

allow transpose(None)

Comments (0)

Files changed (2)

pypy/module/micronumpy/interp_numarray.py

         return W_NDimArray(self.implementation.transpose(self))
 
     def descr_transpose(self, space, args_w):
-        if len(args_w) != 0:
+        if not (len(args_w) == 0 or
+                len(args_w) == 1 and space.is_none(args_w[0])):
             raise OperationError(space.w_NotImplementedError, space.wrap(
                 "axes unsupported for transpose"))
         return self.descr_get_transpose(space)

pypy/module/micronumpy/test/test_numarray.py

         b = a.T
         assert(b[:, 0] == a[0, :]).all()
         assert (a.transpose() == b).all()
+        assert (a.transpose(None) == b).all()
         import sys
         if '__pypy__' in sys.builtin_module_names:
             raises(NotImplementedError, a.transpose, (1, 0, 2))