Skip to content

TYP: np.unique shape-typing - #32215

Merged
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/unique/shape-typing
Aug 7, 2026
Merged

charris merged 1 commit into
numpy:mainfrom
jorenham:typing/unique/shape-typing

Conversation

@jorenham

@jorenham jorenham commented Aug 6, 2026

Copy link
Copy Markdown
Member

The np.unique function is very popular (top 20) but had no shape-typing support whatsoever. This adds shape-typing support for both the default axis=None and axis=<some int> cases. This caused the number of overloads to grow to 66, which is inevitable because of the combinatorial explosion of the three return_ params, each of which can be passed positionally or as keyword.


Fully written by me, pre-reviewed & audited as high-value shape-typing improvement by AI (see https://gist.github.com/jorenham/36c78602a7ca866ddb2a917de48ccdd0).

@jorenham jorenham added this to the 2.6.0 Release milestone Aug 6, 2026
@charris
charris merged commit b82686a into numpy:main Aug 7, 2026
14 of 19 checks passed
@charris

charris commented Aug 7, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

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