diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-11-23 10:35:39 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2016-11-23 10:35:39 -0700 |
commit | f562e5bcf699d3e30c204107c8e843290ac797d0 (patch) | |
tree | ff71142ee03fdd4818f19666cec4a4a778b68736 /doc | |
parent | c9adc35e68b92b10ab0b20069465fd784388bc14 (diff) | |
download | numpy-f562e5bcf699d3e30c204107c8e843290ac797d0.tar.gz |
DEP: Make np.equal and np.not_equal ignore object identity.
This only applies to object arrays. Previously object identity would
override object comparison failures, comparison of objects that did not
return a boolean (arrays), and comparison of objects where the
comparison result did not agree with the object identity result (NaNs)
The first two behaviors have been deprecated since 1.9 and now return
errors. The last has issued a FutureWarning since 1.9 and now returns
the result of the comparison.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/release/1.13.0-notes.rst | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/release/1.13.0-notes.rst b/doc/release/1.13.0-notes.rst index 657d8d88e..4ff0c80ac 100644 --- a/doc/release/1.13.0-notes.rst +++ b/doc/release/1.13.0-notes.rst @@ -29,17 +29,22 @@ Compatibility notes DeprecationWarning to error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +See Changes section for more detail. * ``partition``, TypeError when non-integer partition index is used. * ``NpyIter_AdvancedNew``, ValueError when `oa_ndim == 0` and `op_axes` is NULL * ``negative(bool_)``, TypeError when negative applied to booleans. * ``subtract(bool_, bool_)``, TypeError when subtracting boolean from boolean. +* ``np.equal, np.not_equal``, object identity doesn't override failed comparison. +* ``np.equal, np.not_equal``, object identity doesn't override non-boolean comparison. FutureWarning to changed behavior ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +See Changes section for more detail. * ``numpy.average`` preserves subclasses * ``array == None`` and ``array != None`` do element-wise comparison. +* ``np.equal, np.not_equal``, object identity doesn't override comparison result. C API @@ -74,3 +79,10 @@ array scalar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Previously these operations returned scalars ``False`` and ``True`` respectively. +``np.equal, np.not_equal`` for object arrays ignores object identity +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Previously, these functions always treated identical objects as equal. This had +the effect of overriding comparison failures, comparison of objects that did +not return booleans, such as np.arrays, and comparison of objects where the +results differed from object identity, such as NaNs. + |