GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TYP: add None to ``__getitem__`` in ``numpy.array_api`` by Illviljan · Pull Request #25022 · numpy/numpy

Conversation

@Illviljan

@Illviljan Illviljan commented Oct 28, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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?

  • Closes BUG: array_api.Array has wrong type hints in __getitem__ #24982

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Illviljan added 2 commits October 28, 2023 21:13
@Illviljan
Add None to getitem
ce0638b
@Illviljan
Update _array_object.py
e64d9b4
@melissawm melissawm added the component: numpy.array_api label Oct 31, 2023
rgommers
rgommers approved these changes Nov 13, 2023
View reviewed changes

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was recently fixed upstream, and the discussion in data-apis/array-api#674 shows that this change can be considered a minor bug fix for earlier versions of the standard. So this is good to merge as is. Thanks @Illviljan

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Illviljan reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@rgommers
rgommers merged commit 3c853e1 into numpy:main Nov 13, 2023
@rgommers rgommers changed the title Add None to array_api __getitem__ TYP: add None to __getitem__ in numpy.array_api Nov 13, 2023
@rgommers rgommers added the 41 - Static typing label Nov 13, 2023
@rgommers rgommers added this to the 2.0.0 release milestone Nov 13, 2023
@charris charris added the 09 - Backport-Candidate PRs tagged should be backported label Nov 13, 2023
charris pushed a commit to charris/numpy that referenced this pull request Nov 19, 2023
@Illviljan @charris
TYP: add None to __getitem__ in numpy.array_api (numpy#25022)
f32b223
Closes numpygh-24982
@charris charris changed the title TYP: add None to __getitem__ in numpy.array_api TYP: add None to __getitem__ in numpy.array_api Nov 19, 2023
@charris charris mentioned this pull request Nov 19, 2023
TYP: add None to __getitem__ in numpy.array_api #25188
Merged
1 task done
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Nov 19, 2023
charris pushed a commit to charris/numpy that referenced this pull request Nov 19, 2023
@Illviljan @charris
TYP: add None to __getitem__ in numpy.array_api (numpy#25022)
699c7f0
Closes numpygh-24982
@Illviljan Illviljan mentioned this pull request Dec 4, 2023
Add getitem to array protocol pydata/xarray#8406
Merged
@TimotheusBachinger TimotheusBachinger mentioned this pull request Nov 25, 2024
fix build #27836
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rgommers rgommers rgommers approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

41 - Static typing component: numpy.array_api

Projects

None yet

Milestone

2.0.0 release

Development

Successfully merging this pull request may close these issues.

BUG: array_api.Array has wrong type hints in __getitem__

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Illviljan @rgommers @charris @melissawm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.