Skip to content

TYP: is{real,complex} improved shape-typing - #32637

Merged
charris merged 2 commits into
numpy:mainfrom
jorenham:typing/isreal/shape-typing
Sep 15, 2026
Merged

charris merged 2 commits into
numpy:mainfrom
jorenham:typing/isreal/shape-typing

Conversation

@jorenham

Copy link
Copy Markdown
Member

np.isreal and np.iscomplex now have overloads for 1d and 2d nested sequences.

The strange behavior of (only) np.isreal where Python scalars (bool/int/float/complex) return a builtin.bool instead of a np.bool (as iscomplex does), is now also correctly typed. Maybe that's something we should actually fix in the implementation, but either way, it doesn't have to be blocking for this.


Pair programmed with AI.

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

charris commented Sep 15, 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