Created
April 7, 2015 11:31
-
-
Save z0mbiehunt3r/b56b04708ab236da0b65 to your computer and use it in GitHub Desktop.
python hashing dict
This file contains hidden or 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
>>> my_dict = {'one': 1, 'two': 2, 'a_tuple': ('1', '2', '3')} | |
>>> my_dict.__hash__ is None | |
True | |
>>> frozenset(my_dict.items()) | |
frozenset({('a_tuple', ('1', '2', '3')), ('one', 1), ('two', 2)}) | |
>>> hash(frozenset(my_dict.items())) | |
-8556322717805028753 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment