functools.reduce allows you to apply a function cumulatively to the items of an iterable.
functools.reduce
The code above combines functools.reduce and operator.add to get the cumulative sum of a list.
operator.add
My previous tips on functools.
Hydra: YAML-Based Config Management Made Simple
Loguru: Configure Professional Logging in a Single Line
Simplifying Type Annotations with MonkeyType