Skip to content

TYP: Add type annotations for comparison operators to MaskedArray.#23328

Merged
BvB93 merged 1 commit intonumpy:mainfrom
hawkinsp:macomp
Mar 5, 2023
Merged

TYP: Add type annotations for comparison operators to MaskedArray.#23328
BvB93 merged 1 commit intonumpy:mainfrom
hawkinsp:macomp

Conversation

@hawkinsp
Copy link
Copy Markdown
Contributor

@hawkinsp hawkinsp commented Mar 3, 2023

The comparison operators seem to be missing annotations; whereas pretty much every other operator is annotated.

This causes pytype to conclude that the output of, say, __gt__ is a regular ndarray, which isn't true.

The comparison operators seem to be missing annotations; whereas pretty
much every other operator is annotated.

This causes pytype to conclude that the output of, say, __gt__ is a
regular ndarray, which isn't true.
@hawkinsp hawkinsp changed the title BUG: Add type annotations for comparison operators to MaskedArray. TYP: Add type annotations for comparison operators to MaskedArray. Mar 3, 2023
Copy link
Copy Markdown
Member

@BvB93 BvB93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this is one of those issues that would could have avoided in the first place by not hard-coding the ndarray output type in the superclass, buuuut good luck with that without higher ordered typevars...

@BvB93 BvB93 merged commit 7617e0c into numpy:main Mar 5, 2023
@BvB93 BvB93 added the 09 - Backport-Candidate PRs tagged should be backported label Mar 5, 2023
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Mar 5, 2023
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.

3 participants