Skip to content

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

@bskinn

Description

@bskinn

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions