"""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=funself.__name__=fun.__name__def__call__(self,*args):ifnothasattr(self,'retval'):self.retval=self.fun(*args).unwrap()returnself.retval