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

[python] Remove the Comparable protocol #129

Merged
merged 1 commit into from
Feb 15, 2023
Merged

[python] Remove the Comparable protocol #129

merged 1 commit into from
Feb 15, 2023

Conversation

thetorpedodog
Copy link
Contributor

We don't use it anymore, and it is not useful for static analysis (you only need to implement a subset of the methods to support all comparisons) nor at runtime (every object implements all of the __xx__ methods, but most return NotImplemented, meaning that isinstance(anything, Comparable) was always true even for things that were not comparable, like regular old object().

We don't use it anymore, and it is not useful for static analysis
(you only need to implement a subset of the methods to support all
comparisons) nor at runtime (every object implements all of the `__xx__`
methods, but most return `NotImplemented`, meaning that
`isinstance(anything, Comparable)` was always true even for things that
were not comparable, like regular old `object()`.
@thetorpedodog thetorpedodog merged commit 26bf177 into main Feb 15, 2023
@thetorpedodog thetorpedodog deleted the no-comp branch February 15, 2023 20:39
@johnkerl johnkerl changed the title Remove the Comparable protocol. [python] Remove the Comparable protocol Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants