Sobes.tech
Junior — Middle+

Decorator that saves the results of a function call

livecode

Task condition

Create a decorator that will cache the return value of a function so that it does not execute again when called with the same arguments.

@cached
def slow_function(x):
    …