Skip to content

TYP: Annotate numpy._core._type_aliases.#26944

Merged
rgommers merged 1 commit intonumpy:mainfrom
jorenham:core-type_aliases-annotations
Aug 14, 2024
Merged

TYP: Annotate numpy._core._type_aliases.#26944
rgommers merged 1 commit intonumpy:mainfrom
jorenham:core-type_aliases-annotations

Conversation

@jorenham
Copy link
Copy Markdown
Member

Almost all annotations in
numpy._core._type_aliases were missing.

The only previously existing annotation was for .sctypeDict, which this PR modified to be a Final , and to have a key type of str (instead of int | str).
And because it is exported as numpy.sctypeDict, and therefore part of the public API, a (simple) type-test has been added for it.

@jorenham jorenham force-pushed the core-type_aliases-annotations branch from 37dab0d to 08e286e Compare July 15, 2024 16:48
@jorenham jorenham force-pushed the core-type_aliases-annotations branch from 08e286e to 3704d97 Compare July 22, 2024 03:35
Copy link
Copy Markdown
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Joren, LGTM!

This sat here for a little too long; tests still pass locally after rebasing on main though, so good to go as is.

@rgommers rgommers added this to the 2.2.0 release milestone Aug 14, 2024
@rgommers rgommers merged commit 97ac255 into numpy:main Aug 14, 2024
@jorenham jorenham deleted the core-type_aliases-annotations branch August 14, 2024 20:40
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