Skip to content

Instantly share code, notes, and snippets.

@z0mbiehunt3r
Created April 7, 2015 11:31
Show Gist options
  • Save z0mbiehunt3r/b56b04708ab236da0b65 to your computer and use it in GitHub Desktop.
Save z0mbiehunt3r/b56b04708ab236da0b65 to your computer and use it in GitHub Desktop.
python hashing dict
>>> 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