Skip to content

Commit a890906

Browse files
authored
Clarify expected results for any and all when operating on empty arrays (#388)
* Clarify expected results for `any` and `all` when operating on empty arrays * Update copy
1 parent acf50b7 commit a890906

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spec/API_specification/signatures/utility_functions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ def all(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keep
44
"""
55
Tests whether all input array elements evaluate to ``True`` along a specified axis.
66
7+
.. note::
8+
Positive infinity, negative infinity, and NaN must evaluate to ``True``.
9+
10+
.. note::
11+
If ``x`` is an empty array or the size of the axis (dimension) along which to evaluate elements is zero, the test result must be ``True``.
12+
713
Parameters
814
----------
915
x: array
@@ -23,6 +29,12 @@ def any(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keep
2329
"""
2430
Tests whether any input array element evaluates to ``True`` along a specified axis.
2531
32+
.. note::
33+
Positive infinity, negative infinity, and NaN must evaluate to ``True``.
34+
35+
.. note::
36+
If ``x`` is an empty array or the size of the axis (dimension) along which to evaluate elements is zero, the test result must be ``False``.
37+
2638
Parameters
2739
----------
2840
x: array

0 commit comments

Comments
 (0)