Created
August 9, 2016 12:10
-
-
Save anonymous/5c4c67bf253ee68ffbb94227538df9eb to your computer and use it in GitHub Desktop.
Set uses hash.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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