The documentation for lru_cache gives the function definition:
@functools.lru_cache(maxsize=128, typed=False)
Th
Think about it that way: lru_cache is a decorator factory. You call it (with or without params, but you call it) and it gives you a decorator.
Calling the decorator factory and applying the decorator on one line is the equivalent of this:
with_small_cache = lru_cache(max_size=5)
@with_small_cache
def function():
...