Skip to content

TYP: asarray_chkfinite improved shape-typing - #32639

Merged
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/asarray_chkfinite/shape-typing
Sep 15, 2026
Merged

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

Conversation

@jorenham

Copy link
Copy Markdown
Member

np.asarray_chkfinite now also returns an exact shape-type for sequences of builtin scalars. I didn't add overloads for nested sequences (i.e. 2d) though because a code search showed that that's rarely done in practice. Also, when dtype is given and an array with known static shape-type is provided, that shape-type will now also be propagated.


Pair programmed with Ai

@jorenham jorenham added this to the 2.6.0 Release milestone Sep 15, 2026
@charris
charris merged commit e83341e into numpy:main Sep 15, 2026
16 checks passed
@charris

charris commented Sep 15, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

@jorenham
jorenham deleted the typing/asarray_chkfinite/shape-typing branch September 15, 2026 19:42
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