TypeError: unhashable type: 'list' in Python: 10 Causes and Fixes for Dict Keys, Sets, Counter and lru_cache (Tested Examples)
Python raises TypeError: unhashable type: 'list' when a list is used where a hashable value is required, such as a dict key, a set element or a cached function argument. Here are 10 real causes with tested output from Python 3.13 and 3.14, and the fix for each.