Skip to content

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