Skip to content

TYP: type capabilities max dimensions - #32128

Merged
jorenham merged 1 commit into
numpy:mainfrom
Nin17:type-max-dimensions
Jul 28, 2026
Merged

TYP: type capabilities max dimensions#32128
jorenham merged 1 commit into
numpy:mainfrom
Nin17:type-max-dimensions

Conversation

@Nin17

@Nin17 Nin17 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

PR summary

Add type hint for np.__array_namespace_info__().capabilities()["max dimensions"], previously type checkers would flag its use as an invalid key in a TypedDict.

First time committer introduction

I'm a physicist and have been using NumPy for ~10 years during my undergraduate and PhD. I've recently started using type checkers and the array api standard, and noticed this issue, which seems simple to fix so thought I'd contribute it myself.

AI Disclosure

No AI tools used

@jorenham jorenham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checks out; thanks!

In [1]: np.__array_namespace_info__().capabilities()
Out[1]: {'boolean indexing': True, 'data-dependent shapes': True, 'max dimensions': 64}

@jorenham
jorenham merged commit 7b3e100 into numpy:main Jul 28, 2026
94 checks passed
@jorenham jorenham added the 09 - Backport-Candidate PRs tagged should be backported label Jul 28, 2026
@Nin17
Nin17 deleted the type-max-dimensions branch July 28, 2026 09:25
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 29, 2026
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.

3 participants