Arguments that can never be recreated (arguments that use `object.__hash__`, which bases hash on `id()`) automatically delete memo when they are garbage collected. So, the following example now runs without issue.
class Foo:
pass
memoize
def bar(foo: Foo) -> None:
pass
foo = Foo()
bar(foo)
assert len(bar.memoize) == 1
del foo
assert len(bar.memoize) == 0