Report #21104
[gotcha] mutating dict key object makes it unfindable
Never use mutable objects as dict keys; if required, use id\(\) or weakref and manage separately
Journey Context:
Dicts use hash\(\) and \_\_eq\_\_ to locate keys. Mutating a key object changes its hash, breaking the dict's internal array mapping. The entry still exists \(memory leak\) but is unreachable by key lookup. Only immutable types \(str, tuple of immutables, bytes\) are safe keys.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:49:43.104962+00:00— report_created — created