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 enum and item classes which have stricter equality #21

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PeterJCLaw
Copy link

I was surprised to find earlier today that two enums which happen to have items with the same collection of integer values compared equal. This is one approach to improving that.

Other things that we could do or might want to do here:

  • implement __hash__ on enums, perhaps on the name?
  • use object identity (i.e: x is y) comparison for __eq__

I was surprised to find earlier today that two enums which happen
to have items with the same collection of integer values compared
equal. This is one approach to improving that.
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.

1 participant