Author: Brian Kearns <[email protected]>
Branch:
Changeset: r68466:819adf960b3e
Date: 2013-12-18 04:51 -0500
http://bitbucket.org/pypy/pypy/changeset/819adf960b3e/
Log: fix subtypes of numpy scalars
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -1146,8 +1146,6 @@
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'
diff --git a/pypy/module/micronumpy/test/test_subtype.py
b/pypy/module/micronumpy/test/test_subtype.py
--- a/pypy/module/micronumpy/test/test_subtype.py
+++ b/pypy/module/micronumpy/test/test_subtype.py
@@ -33,6 +33,11 @@
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)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit