Author: Armin Rigo <[email protected]>
Branch:
Changeset: r79922:bb9eab0bf5eb
Date: 2015-10-01 16:32 +0200
http://bitbucket.org/pypy/pypy/changeset/bb9eab0bf5eb/
Log: merge heads
diff --git a/pypy/module/micronumpy/ndarray.py
b/pypy/module/micronumpy/ndarray.py
--- a/pypy/module/micronumpy/ndarray.py
+++ b/pypy/module/micronumpy/ndarray.py
@@ -1308,6 +1308,9 @@
[space.wrap(0)]), space.wrap("b")])
builder = StringBuilder()
+ if self.get_dtype().is_object():
+ raise oefmt(space.w_NotImplementedError,
+ "reduce for 'object' dtype not supported yet")
if isinstance(self.implementation, SliceArray):
iter, state = self.implementation.create_iter()
while not iter.done(state):
diff --git a/pypy/module/micronumpy/test/test_object_arrays.py
b/pypy/module/micronumpy/test/test_object_arrays.py
--- a/pypy/module/micronumpy/test/test_object_arrays.py
+++ b/pypy/module/micronumpy/test/test_object_arrays.py
@@ -3,6 +3,8 @@
class AppTestObjectDtypes(BaseNumpyAppTest):
+ spaceconfig = dict(usemodules=["micronumpy", "struct", "binascii"])
+
def setup_class(cls):
BaseNumpyAppTest.setup_class.im_func(cls)
cls.w_runappdirect = cls.space.wrap(option.runappdirect)
@@ -187,3 +189,21 @@
assert b.shape == (1,)
assert b.dtype == np.float_
assert (b == 1.0).all()
+
+
+ def test__reduce__(self):
+ from numpy import arange, dtype
+ from cPickle import loads, dumps
+ import sys
+
+ a = arange(15).astype(object)
+ if '__pypy__' in sys.builtin_module_names:
+ raises(NotImplementedError, dumps, a)
+ skip('not implemented yet')
+ b = loads(dumps(a))
+ assert (a == b).all()
+
+ a = arange(15).astype(object).reshape((3, 5))
+ b = loads(dumps(a))
+ assert (a == b).all()
+
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit