TYP: ``diagonal`` and ``ndarray.diagonal`` shape-typing by jorenham · Pull Request #31165 · numpy/numpy · GitHub
Skip to content

TYP: diagonal and ndarray.diagonal shape-typing - #31165

Merged
charris merged 2 commits into
numpy:mainfrom
jorenham:typing/diagonal
Apr 7, 2026
Merged

charris merged 2 commits into
numpy:mainfrom
jorenham:typing/diagonal

Conversation

@jorenham

@jorenham jorenham commented Apr 6, 2026

Copy link
Copy Markdown
Member

This adds shape-typing overloads to np.diagonal, np.ndarray.diagonal, and np.ma.MaskedArray.diagonal for the 2d -> 1d and 3d -> 2d cases.

AI Disclosure

N/A

@jorenham jorenham added this to the 2.5.0 Release milestone Apr 6, 2026
@charris
charris merged commit cc3b09b into numpy:main Apr 7, 2026
15 checks passed
@charris

charris commented Apr 7, 2026

Copy link
Copy Markdown
Member

@jorenham
jorenham deleted the typing/diagonal branch April 7, 2026 09:54
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