Hacker News new | ask | show | jobs
by jedberg 2185 days ago
This technique is called Memoization [0]

Here is an implementation of a memoize decorator in Python that will support all inputs [1]. You'd have to modify to not use all the Pylons framework stuff.

[0] https://en.wikipedia.org/wiki/Memoization

[1] https://github.com/reddit-archive/reddit/blob/master/r2/r2/l...