Skip to content

Clarify expected results for any and all when operating on empty arrays #388

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spec/API_specification/signatures/utility_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ def all(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keep
"""
Tests whether all input array elements evaluate to ``True`` along a specified axis.

.. note::
Positive infinity, negative infinity, and NaN must evaluate to ``True``.

.. note::
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``.

Parameters
----------
x: array
Expand All @@ -23,6 +29,12 @@ def any(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keep
"""
Tests whether any input array element evaluates to ``True`` along a specified axis.

.. note::
Positive infinity, negative infinity, and NaN must evaluate to ``True``.

.. note::
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``.

Parameters
----------
x: array
Expand Down