functools.reduce() is useful to apply a function over and over on an iterable to “reduce” it to one single value:
>>> from functools import reduce >>> reduce(lambda x, y: x * y, [1, 2, 3, 4]) 24
functools.cached_property is available in Python 3.8 and above and allows you to cache class properties. Once a property is evaluated, it won’t be evaluated again.
functools.lru_cache allows you to cache recursive function calls in a least recently used cache. This can optimize functions with multiple recursive calls like the Fibonnacci sequence.
You can check out the Python documentation on the