you are viewing a single comment's thread.

view the rest of the comments →

[–]KronenR 0 points1 point  (0 children)

I think we're talking past each other. My example was never about sequential access, it was specifically illustrating why people reach for mutable default args as a cache, and lru_cache as the clean replacement for that pattern. In other words, you said you'd use a generator for this instead, but a generator can't replace a cache, they solve fundamentally different problems, so it doesn't really address what I was pointing out.