[pypy-commit] pypy object-dtype2: add test, fix bool

2015-04-19 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: object-dtype2
Changeset: r76836:f86e55aeb94a
Date: 2015-04-19 18:48 +0300
http://bitbucket.org/pypy/pypy/changeset/f86e55aeb94a/

Log:add test, fix bool

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
@@ -35,6 +35,8 @@
 assert b == complex(1, -1)
 b = np.array(complex(1, -1)) and a
 assert (b == a).all()
+c = np.array([1, 2, 3])
+assert (a[0] != c[0])
 
 def test_logical_ufunc(self):
 import numpy as np
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
@@ -1746,6 +1746,7 @@
 return v1
 return v2
 
+@raw_unary_op
 def bool(self,v):
 return self._obool(v)
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit


[pypy-commit] pypy object-dtype2: add test

2015-04-03 Thread mattip
Author: mattip matti.pi...@gmail.com
Branch: object-dtype2
Changeset: r76696:7e5953936ded
Date: 2015-04-03 00:23 +0300
http://bitbucket.org/pypy/pypy/changeset/7e5953936ded/

Log:add test

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
@@ -24,7 +24,7 @@
 
 a = np.array([foo], dtype=object)
 b = np.array([bar], dtype=object)
-
+raises(TypeError, np.add, a, 1)
 res = a + b
 assert res[0] == foobar
 
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit