Skip to content

Conversation

@charris
Copy link
Member

@charris charris commented Apr 19, 2025

Backport of #28750.

This fixes the following valid usage in https://github.com/data-apis/array-api-compat/blob/16978e63b744185bc4ced4677c822468e6ddebd2/array_api_compat/numpy/_aliases.py#L126-L127 from being falsely rejected:

def count_nonzero(
    x: Array,
    axis: int | tuple[int, ...] | None = None,
    keepdims: py_bool = False,
) -> Array:
    result = np.count_nonzero(x, axis=axis, keepdims=keepdims)

@charris charris added 08 - Backport Used to tag backport PRs 41 - Static typing labels Apr 19, 2025
Co-authored-by: Joren Hammudoglu <jhammudoglu@gmail.com>
@charris charris merged commit b3e772c into numpy:maintenance/2.2.x Apr 19, 2025
69 checks passed
@charris
Copy link
Member Author

charris commented Apr 19, 2025

Thanks Joren.

@charris charris deleted the backport-28750 branch April 19, 2025 13:18
@jorenham
Copy link
Member

Thanks Joren.

Right back at ya

penguinpee added a commit to penguinpee/numpy that referenced this pull request Sep 25, 2025
The return type of the function was changed in 2.3.0, but the docstring
remained the same (numpygh-28774).
penguinpee added a commit to penguinpee/numpy that referenced this pull request Oct 6, 2025
The return type of the function was changed in 2.3.0, but the docstring
remained the same (numpygh-28774).
MaanasArora pushed a commit to MaanasArora/numpy that referenced this pull request Oct 13, 2025
The return type of the function was changed in 2.3.0, but the docstring
remained the same (numpygh-28774).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 - Backport Used to tag backport PRs 41 - Static typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants