Skip to content

Instantly share code, notes, and snippets.

Created August 9, 2016 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5c4c67bf253ee68ffbb94227538df9eb to your computer and use it in GitHub Desktop.
Save anonymous/5c4c67bf253ee68ffbb94227538df9eb to your computer and use it in GitHub Desktop.
Set uses hash.
>>> class H(int):
... def __hash__(self):
... return 0
...
>>> H(1) == 1
True
>>> {H(1),1}
{1, 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment