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

Add plugin to typecheck functools.total_ordering #7848

Closed
wants to merge 6 commits into from

Conversation

aecay
Copy link
Contributor

@aecay aecay commented Nov 1, 2019

This PR adds a plugin to typecheck classes decorated with functools.total_ordering, as requested in #4610 .

  • The plugin validates the preconditions of @total_ordering (that the class must define __eq__ and one other dunder inequality methods)
  • Unit test cases are added

Now that we consider inherited methods from superclasses, a class will
never fail typechecking for lack of __eq__ (which is inherited from
object).  However, this method is unlikely to provide the correct
semantics.
@msullivan msullivan self-requested a review November 13, 2019 21:18
@msullivan
Copy link
Collaborator

I'm going to review this, but also note that it will need a rebase on top of #7829

@ilevkivskyi
Copy link
Member

ilevkivskyi commented Nov 13, 2019

@msullivan Note there is a competing PR #7831 that is 1 day older. I am not sure what to do, but it looks like we will need to close one in favor of another, or maybe somehow combine best parts of both. Up to you.

@msullivan
Copy link
Collaborator

Closing this because the author felt it was a worse base to work from than #7831. (Which I will probably also close.) Feel free to pick it back up though.

@msullivan msullivan closed this Oct 18, 2020
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