Skip to content

MAINT,TYP: Add object-overloads for the np.generic rich comparisons#21984

Merged
mattip merged 1 commit intonumpy:mainfrom
BvB93:comparison
Jul 17, 2022
Merged

MAINT,TYP: Add object-overloads for the np.generic rich comparisons#21984
mattip merged 1 commit intonumpy:mainfrom
BvB93:comparison

Conversation

@BvB93
Copy link
Copy Markdown
Member

@BvB93 BvB93 commented Jul 14, 2022

Closes #21939

An overload was previously missing for object-based rich comparisons of the np.generic subclasses.

As object array-likes are notoriously difficult to type, the new overload simply checks whether the right operand supports __gt__ or __lt__ even though this will, in practice, be a bit too broad (e.g. it allows np.int64(1) > "test" to pass).

@mattip
Copy link
Copy Markdown
Member

mattip commented Jul 17, 2022

Thanks @BvB93

@BvB93 BvB93 deleted the comparison branch July 18, 2022 15:03
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Jul 24, 2022
@charris charris removed this from the 1.23.2 release milestone Jul 24, 2022
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.

BUG: _ComparisonOp doesn't support numeric interoperability?

3 participants