Author: mattip
Branch:
Changeset: r61136:78737ede9909
Date: 2013-02-12 17:09 +0200
http://bitbucket.org/pypy/pypy/changeset/78737ede9909/
Log: test, fix missing dtype in coerce
diff --git a/pypy/module/micronumpy/test/test_numarray.py
b/pypy/module/micronumpy/test/test_numarray.py
--- a/pypy/module/micronumpy/test/test_numarray.py
+++ b/pypy/module/micronumpy/test/test_numarray.py
@@ -1666,6 +1666,9 @@
a = arange(6, dtype='f4').reshape(2,3)
b = a.astype('i4')
+ a = array('x').astype('S3').dtype
+ assert a.itemsize == 3
+
def test_base(self):
from _numpypy import array
assert array(1).base is None
diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -1603,7 +1603,7 @@
arr = interp_boxes.VoidBoxStorage(len(arg), new_string_dtype(space,
len(arg)))
for i in range(len(arg)):
arr.storage[i] = arg[i]
- return interp_boxes.W_StringBox(arr, 0, None)
+ return interp_boxes.W_StringBox(arr, 0, arg.dtype)
@jit.unroll_safe
def store(self, arr, i, offset, box):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit