Help on class CacheOutput in module fridge:
class CacheOutput(builtins.object)
| Class-based decorator used to avoid re-calculating a function.
| The first time the function is called, it initializes a MiniFridge.
| Each time the function is called, input arguments are hashed.
| The resulting hash is used as a MiniFridge key, and the outputs of
| calling the function are stored for a limited time.
|
| Set timer using keyword arguments for datetime.timedelta:
| weeks, days, hours, minutes, seconds, microseconds, milliseconds
|
| Example:
|
| @CacheOutput(hours=1)
| def cached_power_tower(x,N):
| for n in range(N):
| x *= x
| return x
|
| WARNING: @CacheOutput stores *outputs* of a function.
| It does not replicate *side effects* of a function!
|
| Caution: Not well-tested yet, especially with multi-threading.
|
| Methods defined here:
|
| __call__(self, func, *args, **kwargs)
| Call self as a function.
|
| __init__(self, **kwargs)
| Create a MiniFridge with timer set by timedelta arguments
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __dict__
| dictionary for instance variables (if defined)
|
| __weakref__
| list of weak references to the object (if defined)