Skip to content

BUG: Allow MaskedArray.__eq__ and __ne__ to return NotImplemented. - #10104

Closed
mhvk wants to merge 1 commit into
numpy:masterfrom
mhvk:ma-comparison-allow-not-implemented
Closed

mhvk wants to merge 1 commit into
numpy:masterfrom
mhvk:ma-comparison-allow-not-implemented

Conversation

@mhvk

@mhvk mhvk commented Nov 27, 2017

Copy link
Copy Markdown
Contributor

Comparison was based on using operator.eq and operator.ne on the underlying arrays. This goes wrong, however, if one of those does not know how to deal properly with the other - as was exposed by astropy issue astropy/astropy#6838.

@charris - is there any hope to still have this in 1.14?

p.s. I somewhat on purpose made the somewhat ugly lambda definitions in __eq__ and __ne__ as I didn't want to gratuitously change the API of _compare. It's easy to change it to just passing on the string.

Comparison was based on using operator.eq and operator.ne on the
underlying arrays. This goes wrong, however, if one of those does
not know how to deal properly with the other - as was exposed by
astropy issue astropy/astropy#6838.
@mhvk

mhvk commented Nov 27, 2017

Copy link
Copy Markdown
Contributor Author

@charris - actually - am not sure this is the correct approach. So, just ignore for now; it is definitely a corner case.

@mhvk

mhvk commented Nov 28, 2017

Copy link
Copy Markdown
Contributor Author

Now quite sure the current code is fine, or at least more correct than this one, so closing.

@mhvk mhvk closed this Nov 28, 2017
@mhvk
mhvk deleted the ma-comparison-allow-not-implemented branch December 21, 2018 02:09
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.

1 participant