Skip to content

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

Merged
charris merged 1 commit into
numpy:maintenance/1.26.xfrom
charris:backport-25022
Nov 19, 2023
Merged

TYP: add None to __getitem__ in numpy.array_api#25188
charris merged 1 commit into
numpy:maintenance/1.26.xfrom
charris:backport-25022

Conversation

@charris
Copy link
Copy Markdown
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