4 ms·
Yep, here's how it plays out: Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ] :: Anaconda, Inc. on darwin >>> d=dict() >>> l=[1,2,3] >
by mturmon 5y ago
Yep, here's how it plays out:
Python 3.8.5 (default, Sep 4 2020, 02:22:02)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
>>> d=dict()
>>> l=[1,2,3]
>>> d[l]=42
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
- setr 5y agohttps://pypi.org/project/forbiddenfruit/ https://pypi.org/project/forbiddenfruit/ Apparently there are ways to monkey patch core types, so you could probably add a __hash__ method to list…