Commits

mattip  committed a130f27

pass tests using cpython by adding '>g','<g','=g' dtypes
latest pypy fails to run tests

  • Participants
  • Parent commits fe6cb9e
  • Branches missing-ndarray-attributes

Comments (0)

Files changed (1)

File pypy/module/micronumpy/interp_dtype.py

                 return dtype
             if w_dtype is dtype.w_box_type:
                 return dtype
-    raise OperationError(space.w_TypeError, space.wrap("data type not understood"))
+    raise OperationError(space.w_TypeError, space.wrap("data type %s not understood"))
 
 W_Dtype.typedef = TypeDef("dtype",
     __module__ = "numpypy",
                 itemtype,
                 dtype.num, dtype.kind, new_name, dtype.char, dtype.w_box_type,
                 native=False)
+            if dtype.kind != dtype.char:
+                can_name = dtype.char
+                self.dtypes_by_name[byteorder_prefix + can_name] = dtype
+                self.dtypes_by_name['=' + can_name] = dtype
+                new_name = nonnative_byteorder_prefix + can_name
+                self.dtypes_by_name[new_name] = W_Dtype(
+                    itemtype,
+                    dtype.num, dtype.kind, new_name, dtype.char, dtype.w_box_type,
+                    native=False)
+
             for alias in dtype.aliases:
                 self.dtypes_by_name[alias] = dtype
             self.dtypes_by_name[dtype.char] = dtype