Popular recipes tagged "memoization" but not "cache"http://code.activestate.com/recipes/tags/memoization-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> Minimalistic Memoization (Python) 2010-05-06T16:59:52-07:00Ahmed El Deebhttp://code.activestate.com/recipes/users/4173897/http://code.activestate.com/recipes/577219-minimalistic-memoization/ <p style="color: grey"> Python recipe 577219 by <a href="/recipes/users/4173897/">Ahmed El Deeb</a> (<a href="/recipes/tags/caching/">caching</a>, <a href="/recipes/tags/memoization/">memoization</a>, <a href="/recipes/tags/recursion/">recursion</a>). </p> <p>Minimalistic Memoization in python, just works, doesn't take care of cleaning up the cache however.</p> Lazy Lists for python 2.5 (Python) 2008-08-18T19:59:03-07:00Michael Pusthttp://code.activestate.com/recipes/users/4166509/http://code.activestate.com/recipes/576429-lazy-lists-for-python-25/ <p style="color: grey"> Python recipe 576429 by <a href="/recipes/users/4166509/">Michael Pust</a> (<a href="/recipes/tags/generators/">generators</a>, <a href="/recipes/tags/lazy/">lazy</a>, <a href="/recipes/tags/memoization/">memoization</a>). </p> <p>Dan Spitz submitted a recipe ( <a href="http://code.activestate.com/recipes/576410/">576410</a> ) for recursively defined lazy lists backed by a generator. Only catch was that it was written for python 3k. But there is nothing intrinsic in 3k that prevents you from having the same functionality in python 2.5, so I am supplying the backport here.</p> Lazy Lists (Python) 2008-08-08T10:23:52-07:00Dan Spitzhttp://code.activestate.com/recipes/users/4166237/http://code.activestate.com/recipes/576410-lazy-lists/ <p style="color: grey"> Python recipe 576410 by <a href="/recipes/users/4166237/">Dan Spitz</a> (<a href="/recipes/tags/generators/">generators</a>, <a href="/recipes/tags/lazy/">lazy</a>, <a href="/recipes/tags/memoization/">memoization</a>). Revision 6. </p> <p>This is a (python 3.0) recipe for LazyLists, or ordered sequences whose contents are generated lazily by an iterator.</p>