8000 TYP: add None to ``__getitem__`` in ``numpy.array_api`` by charris · Pull Request #25188 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TYP: add None to __getitem__ in numpy.array_api #25188

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
Nov 19, 2023

Conversation

charris
Copy link
Member
@charris charris commented Nov 19, 2023

Backport of #25022.

Add None to the getitem type hints.

The array_api site doesn't mention it in the getitem page until the draft version however:
https://data-apis.org/array-api/draft/API_specification/generated/array_api.array.__getitem__.html

But it is mentioned in the 2021.12 version in the indexing page:

Each None in the selection tuple must expand the dimensions of the resulting selection by one dimension of size 1. The position of the added dimension must be the same as the position of None in the selection tuple.
https://data-apis.org/array-api/2021.12/API_specification/indexing.html

Which of these pages takes priority?

@charris charris merged commit f0c22fe into numpy:maintenance/1.26.x Nov 19, 2023
@charris charris deleted the backport-25022 branch November 19, 2023 22:17
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