Skip to content

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

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

TYP: isclose shape-typing fix for 2d array-likes#32205
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/isclose/fix-shape-typing

Conversation

@jorenham

@jorenham jorenham commented Aug 5, 2026

Copy link
Copy Markdown
Member

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).

@jorenham jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing labels Aug 5, 2026
@charris
charris merged commit 95f678b into numpy:main Aug 7, 2026
15 checks passed
@charris

charris commented Aug 7, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

@jorenham
jorenham deleted the typing/isclose/fix-shape-typing branch August 7, 2026 08:55
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Aug 7, 2026
charris added a commit that referenced this pull request Aug 7, 2026
TYP: ``isclose`` shape-typing fix for 2d array-likes (#32205)
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