Skip to content

Commit 95332bb

Browse files
hameerabbasikgryte
andauthored
Fix wording for comparison operators
PR-URL: #736 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]>
1 parent 293512d commit 95332bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

spec/2022.12/API_specification/array_object.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ A conforming implementation of the array API standard must provide and support a
163163
- `operator.ne(x1, x2) <https://docs.python.org/3/library/operator.html#operator.ne>`_
164164
- `operator.__ne__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__ne__>`_
165165

166-
Comparison operators should be defined for arrays having any data type.
166+
:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators should be defined for arrays having any data type.
167+
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).
167168

168169
In-place Operators
169170
~~~~~~~~~~~~~~~~~~

spec/draft/API_specification/array_object.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ A conforming implementation of the array API standard must provide and support a
163163
- `operator.ne(x1, x2) <https://docs.python.org/3/library/operator.html#operator.ne>`_
164164
- `operator.__ne__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__ne__>`_
165165

166-
Comparison operators should be defined for arrays having any data type.
166+
:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators should be defined for arrays having any data type.
167+
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).
167168

168169
In-place Operators
169170
~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)