Skip to content

TYP: isclose shape-typing fix for 2d array-likes (#32205) - #32220

Merged
charris merged 1 commit into
numpy:maintenance/2.5.xfrom
charris:backport-32205
Aug 7, 2026
Merged

TYP: isclose shape-typing fix for 2d array-likes (#32205)#32220
charris merged 1 commit into
numpy:maintenance/2.5.xfrom
charris:backport-32205

Conversation

@charris

@charris charris commented Aug 7, 2026

Copy link
Copy Markdown
Member

Backport of #32205.

This fixes two shape-typing issues in np.isclose:

  • 2d nested sequences returned a 1d array (copy-paste gone bad)
  • >0d rtol / atol are broadcasted against a and b and could therefore result in wrong output shape-type (rare in practice though ~2-3% of code search hits)

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

@charris charris added 08 - Backport Used to tag backport PRs 41 - Static typing labels Aug 7, 2026
@charris charris added this to the 2.5.2 release milestone Aug 7, 2026
@charris
charris merged commit 3c7ac97 into numpy:maintenance/2.5.x Aug 7, 2026
12 checks passed
@charris
charris deleted the backport-32205 branch August 7, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 - Backport Used to tag backport PRs 41 - Static typing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants