-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Competitive testing confirms cachekit handles unhashable arguments (lists, dicts, nested structures) that crash lru_cache and cachetools. This is a genuine competitive advantage worth highlighting.
Evidence
# lru_cache — crashes
@lru_cache(maxsize=128)
def fn(data): return sum(data)
fn([1, 2, 3]) # TypeError: unhashable type: 'list'
# cachetools — crashes
@cached(cache=TTLCache(maxsize=128, ttl=300))
def fn(data): return sum(data)
fn([1, 2, 3]) # TypeError: unhashable type: 'list'
# cachekit — works
@cache(backend=None, ttl=300)
def fn(data): return sum(data)
fn([1, 2, 3]) # 6 ✓
fn({"value": 21}) # works via content-based hashing ✓
fn({"users": [{"name": "alice", "tags": ["admin"]}]}) # nested ✓Current State
This already works via content-based hashing (Blake2b of MessagePack-serialized args). However:
- It's not prominently documented as a feature
- The comparison doc doesn't call it out as an advantage
- There are no docs explaining HOW it works (content-based hashing)
Suggested Actions
- Add "Unhashable Arguments" section to comparison.md
- Document content-based key generation in backends/index.md
- Add examples to getting-started.md showing dict/list args
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request