This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author drakebohan
Recipients drakebohan, iritkatriel, rhettinger, sfreilich
Date 2021-11-16.04:54:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637038479.7.0.851521769556.issue41114@roundup.psfhosted.org>
In-reply-to
Content
The problem is that you can't use a list as the key in a dict, since dict keys need to be immutable.  This means that when you try to hash an unhashable object it will result an error. For ex. when you use a list as a key in the dictionary , this cannot be done because lists can't be hashed. The standard way to solve this issue is to cast a list to a tuple . TypeError: unhashable type: 'list' usually means that you are trying to use a list as an hash argument. The standard way to solve this issue is to cast a list to tuple.

Though tuples may seem similar to lists, they are often used in different situations and for different purposes. Tuples can be used as keys if they contain only strings, numbers, or tuples; if a tuple contains any mutable object either directly or indirectly, it cannot be used as a key. You can’t use lists as key.

http://net-informations.com/python/iq/unhashable.htm
History
Date User Action Args
2021-11-16 04:54:39drakebohansetrecipients: + drakebohan, rhettinger, sfreilich, iritkatriel
2021-11-16 04:54:39drakebohansetmessageid: <1637038479.7.0.851521769556.issue41114@roundup.psfhosted.org>
2021-11-16 04:54:39drakebohanlinkissue41114 messages
2021-11-16 04:54:39drakebohancreate