how can i memoize a class instantiation in python?,self.somevalue = somevalue