I'm new to python and i couldn't find an answer online. lets say i have a method which does some computation and returns a string
def output(self)
a=self.some_long computation1()
b=self.some_long computation2()
c=self.some_attribute
some_computatuion_inside
return output_string
I'm using this function in a few places and want to memoize it, but since it takes no arguments and depends on instance attributes which can change between calls, im not sure how to proceed,
i realize i can write my own memoization function which will check if those attributes changed, but that seems incorrect, because that would be specific to this function only and i would like maybe in the future to do the same for other functions