Memoize/cache partial function

So the quick answer is that you can throw an exception in your cached function (which prevents caching) and then catch it in your code. If you want to get all fancy, you can hermetically seal this logic away by copy-pasting the partial_cache decorator in this gist.

1 Like