summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2013-07-25 16:10:54 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2014-05-04 18:14:11 +0200
commit9b8f6c72caea0c6f3fa08b304135239636e4f165 (patch)
treeb3418650ed740be1bb369f5ab2979749d4d27919 /numpy/core/numeric.py
parent84831ca7b7926bf1c73e1702201e7591c55588a3 (diff)
downloadnumpy-9b8f6c72caea0c6f3fa08b304135239636e4f165.tar.gz
DEP: Deprecate that comparisons ignore errors.
This means that for example broadcasting errors get raised. The array_equiv function is changed to explicitely test if broadcasting is possible. It may be nice to do this test differently, but I am not sure if that is possible. Create a FutureWarning for comparisons to None, which should result in areal elementwise (object) comparisons. Slightly adepted a wrong test. Poly changes: Some changes in the polycode was necessary, the one is probably a bug fix, the other needs to be thought over, since len check is not perfect maybe, since it is more liekly to raise raise an error. Closes gh-3759 and gh-1608
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 8c569ea15..7962f9679 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -2388,10 +2388,12 @@ def array_equiv(a1, a2):
except:
return False
try:
- return bool(asarray(a1 == a2).all())
- except ValueError:
+ multiarray.broadcast(a1, a2)
+ except:
return False
+ return bool(asarray(a1 == a2).all())
+
_errdict = {"ignore":ERR_IGNORE,
"warn":ERR_WARN,