Skip to content

Commit 65d3102

Browse files
authored
Corrected typo in __bool__ with backport (#785)
1 parent 91ff864 commit 65d3102

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/array_api_stubs/_2022_12/array_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def __bool__(self: array, /) -> bool:
237237
- If ``self`` is either ``+infinity`` or ``-infinity``, the result is ``True``.
238238
- If ``self`` is either ``+0`` or ``-0``, the result is ``False``.
239239
240-
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical AND of ``bool(real(self))`` and ``bool(imag(self))``.
240+
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical OR of ``bool(real(self))`` and ``bool(imag(self))``.
241241
242242
.. versionchanged:: 2022.12
243243
Added boolean and complex data type support.

src/array_api_stubs/_2023_12/array_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def __bool__(self: array, /) -> bool:
239239
- If ``self`` is either ``+infinity`` or ``-infinity``, the result is ``True``.
240240
- If ``self`` is either ``+0`` or ``-0``, the result is ``False``.
241241
242-
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical AND of ``bool(real(self))`` and ``bool(imag(self))``.
242+
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical OR of ``bool(real(self))`` and ``bool(imag(self))``.
243243
244244
**Lazy implementations**
245245

src/array_api_stubs/_draft/array_object.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def __bool__(self: array, /) -> bool:
239239
- If ``self`` is either ``+infinity`` or ``-infinity``, the result is ``True``.
240240
- If ``self`` is either ``+0`` or ``-0``, the result is ``False``.
241241
242-
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical AND of ``bool(real(self))`` and ``bool(imag(self))``.
242+
For complex floating-point operands, special cases must be handled as if the operation is implemented as the logical OR of ``bool(real(self))`` and ``bool(imag(self))``.
243243
244244
**Lazy implementations**
245245

0 commit comments

Comments
 (0)