-
-
Save masak/1afe22b244fcc9255f7a to your computer and use it in GitHub Desktop.
using a dict as a dict key fails in Python
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
$ 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