summaryrefslogtreecommitdiff
path: root/doc/release/upcoming_changes/22707.expired.rst
blob: 496752e8d52f7c89208ecb25f8e769bad7b25b28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
``==`` and ``!=`` warnings finalized
------------------------------------
The ``==`` and ``!=`` operators on arrays now always:

* raise errors that occur during comparisons such as when the arrays
  have incompatible shapes (``np.array([1, 2]) == np.array([1, 2, 3])``).
* return an array of all ``True`` or all ``False`` when values are
  fundamentally not comparable (e.g. have different dtypes).  An example
  is ``np.array(["a"]) == np.array([1])``.

This mimics the Python behavior of returning ``False`` and ``True``
when comparing incompatible types like ``"a" == 1`` and ``"a" != 1``.
For a long time these gave ``DeprecationWarning`` or ``FutureWarning``.