diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2013-07-10 16:49:59 +0200 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2014-05-04 18:14:11 +0200 |
commit | 84831ca7b7926bf1c73e1702201e7591c55588a3 (patch) | |
tree | b9ed73a6c93178ddd7826ae82bd550e9891560dc /numpy/testing/numpytest.py | |
parent | 19feb8849392a11fad6474f8bab5cd28e50952f1 (diff) | |
download | numpy-84831ca7b7926bf1c73e1702201e7591c55588a3.tar.gz |
FIX: Make object comparison ufuncs not include identity check
The issue here is that PyObject_RichCompareBool does an identity
check before doing any other checks. This is good, and is the
way for example list comparisons are handled. However in numpy
comparisons are elementwise, so that the identitycheck should
not be expected. The example for this is as follows:
obj_array = np.arange(3)
a = np.array([obj_array, 0], dtype=object)
np.equal(a, a)
If an identity check is done, this returns [True, True]. But
obj_array == obj_array itself cannot be cast to a bool.
While this is slightly slower, not doing the identity check seems
more logical in the light of elementwise operations.
Closes gh-2117.
Diffstat (limited to 'numpy/testing/numpytest.py')
0 files changed, 0 insertions, 0 deletions