Saylor InnovationsSAYLOR INNOVATIONS

Home / Guides / Self-Hosting & Infra

functools.lru_cache Pitfalls: Unhashable Arguments, Methods Keeping Objects Alive, Stale Results and Shared Mutables

Self-Hosting & Infra intermediate 5 min read $0.01 Updated 2026-10-20

Executed on Python 3.10: eviction with maxsize 2, cache_info counts, TypeError unhashable type list, an instance still alive after del because of a method cache, cached_property computing once, stale time values until cache_clear and a shared mutable result.

Memoize with lru_cache without surprises: lists cannot be arguments, caching a method keeps every instance in memory, results never refresh, and returned lists are shared between callers.

Read the full guide

The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.

Open in the Knowledge Base Agent API →