8000 TYP: fix `count_nonzero` signature by jorenham · Pull Request #28750 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TYP: fix count_nonzero signature #28750

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 1 commit into from
Apr 18, 2025
Merged

Conversation

jorenham
Copy link
Member

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)

@jorenham jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing labels Apr 17, 2025
@charris charris merged commit b59d8ce into numpy:main Apr 18, 2025
75 checks passed
@charris
Copy link
Member
charris commented Apr 18, 2025

Thanks Joren.

@jorenham jorenham deleted the typing/count_nonzero branch April 18, 2025 18:23
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0