"""Caches the return value of a function -> Result, regardless of input params"""classcached():""" A decorator to make the function cache its return value, regardless of input """def__init__(self,fun):self.fun=fundef__call__(self,*args):ifnothasattr(self,'retval'):self.retval=self.fun(*args).unwrap()returnself.retval