Skip to content

Instantly share code, notes, and snippets.

@masak

masak/run Secret

Created May 24, 2015 21:07
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 masak/1afe22b244fcc9255f7a to your computer and use it in GitHub Desktop.
Save masak/1afe22b244fcc9255f7a to your computer and use it in GitHub Desktop.
using a dict as a dict key fails in Python
$ python3
Python 3.4.0 (default, Apr 11 2014, 13:05:11)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> d = { "a": 42 }
>>> d2 = { d: 666 }
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'dict'
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment