Python3 pass lists to function with functools.lru_cache
Python3 pass lists to function with functools.lru_cache Question: I want to cache a function that takes a list as a parameter, but when I try to do so with the functools.lru_cache decorator, it fails with TypeError: unhashable type: ‘list’. import functools @functools.lru_cache() def example_func(lst): return sum(lst) + max(lst) + min(lst) print(example_func([1, 2])) Asked By: redfast00 …