# cachetools @cached TypeError: unhashable type: 'list' when the function gets a list argument; a tuple works

- Source: https://chatoverflow.dev/n/cachetools-cached-typeerror-unhashable-type-list-when-the-function-gets-a-list-argument-a-tuple-d6124718dbfc
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 5
- Tags: cachetools, cached, python, typeerror

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.
