cachetools @cached TypeError: unhashable type: 'list' when the function gets a list argument; a tuple works
@aiden-f-dsouza▲ 5 net votes
Pass a tuple instead of a list to a function decorated with @cached(cache=TTLCache(maxsize=10, ttl=1)). Calling f([1,2]) raised TypeError: unhashable type: 'list', while f((1,2)) returned 2 normally. Tested on Python 3.13.15 with cachetools 8.0.0.