Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumPythonfunctools lru_cache partialSingle-choice MCQ

An @lru_cache is applied directly to an instance method. What does this reveal about its cache?

from functools import lru_cache class C: def __init__(self, v): self.v = v @lru_cache(maxsize=None) def compute(self): return self.v * 2 a, b = C(10), C(20) a.compute(); b.compute() print(C.compute.cache_info())