3 ms·
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
by jedberg 6y 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 https://en.wikipedia.org/wiki/Memoization
[1] https://github.com/reddit-archive/reddit/blob/master/r2/r2/lib/memoize.py https://github.com/reddit-archive/reddit/blob/master/r2/r2/l...