Popular recipes tagged "memoize" but not "cache"http://code.activestate.com/recipes/tags/memoize-cache/2012-01-02T05:53:19-08:00ActiveState Code RecipesMemoize Generator (Python) 2012-01-02T05:53:19-08:00Peter Donishttp://code.activestate.com/recipes/users/4180313/http://code.activestate.com/recipes/577992-memoize-generator/ <p style="color: grey"> Python recipe 577992 by <a href="/recipes/users/4180313/">Peter Donis</a> (<a href="/recipes/tags/decorators/">decorators</a>, <a href="/recipes/tags/generators/">generators</a>, <a href="/recipes/tags/memoization/">memoization</a>, <a href="/recipes/tags/memoize/">memoize</a>). Revision 2. </p> <p>A wrapper class for generators that "memoizes" them, so that even if the generator is realized multiple times, each term only gets computed once (after that the result is simply returned from a cache).</p>