Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable (subset of) comparison dunder methods inherited from tuple #92

Open
bskinn opened this issue Sep 12, 2019 · 1 comment
Open
Labels
bug Something isn't working
Milestone

Comments

@bskinn
Copy link
Owner

bskinn commented Sep 12, 2019

In the course of trying to figure out a way to report the method inheritance cascade, I noticed that, e.g, StdioManager has the comparison methods inherited from tuple:

__le__               :: <slot wrapper '__le__' of 'tuple' objects>
__lt__               :: <slot wrapper '__lt__' of 'tuple' objects>

Comparing tuples of stream objects, with the possible exception of == and !=, makes no sense.

Probably the best solution is an intervening class in the hierarchy, say NoCompTuple, which overrides __le__ et al. with a simple return NotImplemented?

@bskinn bskinn added the bug Something isn't working label Sep 12, 2019
@bskinn bskinn changed the title Disable comparison dunder methods inherited from tuple Disable (subset of) comparison dunder methods inherited from tuple Sep 12, 2019
@bskinn
Copy link
Owner Author

bskinn commented Sep 13, 2019

Although, I guess it's probably fine to just let the natural TypeError propagate up, from when tuple tries its element-wise comparisons.

(In)equality seems to work ok on the tuple base.

Probably can just close this w/o action, @jayvdb?

@bskinn bskinn added this to the v2.0 milestone Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant