From 9b8f6c72caea0c6f3fa08b304135239636e4f165 Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Thu, 25 Jul 2013 16:10:54 +0200 Subject: 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 --- numpy/core/numeric.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'numpy/core/numeric.py') 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, -- cgit v1.2.1