#compsci #python A module for [[Higher-order function|higher-order functions]]: functions that act on or return other functions ## @lru_cache A simple decorator cache for [[Memoization|memoization]] in recursive functions when a function is called a lot of times: ```python import functools @functools.lru_cache() def f(n): # some recursive shit ``` Argument - maxsize=number, size of the cache. Set to "None" to let the cache grow without bound