persistent memoization in python,time.sleep(1)