Skip to content

TYP: fix complex_sort for builtin sequences - #31917

Merged
charris merged 1 commit into
numpy:mainfrom
jorenham:typing/complex_sort-builtin-sequences
Jul 8, 2026
Merged

charris merged 1 commit into
numpy:mainfrom
jorenham:typing/complex_sort-builtin-sequences

Conversation

@jorenham

@jorenham jorenham commented Jul 8, 2026

Copy link
Copy Markdown
Member

complex_sort accepts builtin scalar sequences at runtime :

In [1]: np.sort_complex([1,2])
Out[1]: array([1.+0.j, 2.+0.j])

But the stubs rejected this, so this adds an additional overload to handle this case.


Fully written by me (a human); bug found by Claude Fable 5 (here's the full (second) audit for those interested).

(even more stub fixes on the way)

@jorenham jorenham added 09 - Backport-Candidate PRs tagged should be backported 41 - Static typing labels Jul 8, 2026
@charris
charris merged commit df3de39 into numpy:main Jul 8, 2026
14 checks passed
@charris

charris commented Jul 8, 2026

Copy link
Copy Markdown
Member

Thanks Joren.

@jorenham
jorenham deleted the typing/complex_sort-builtin-sequences branch July 8, 2026 12:42
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 8, 2026
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