Popular recipes tagged "cyclic_iterator" but not "python"http://code.activestate.com/recipes/tags/cyclic_iterator-python/2010-01-20T03:54:15-08:00ActiveState Code RecipesTechnique for cyclical iteration (Python)
2009-12-03T23:08:38-08:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/576961-technique-for-cyclical-iteration/
<p style="color: grey">
Python
recipe 576961
by <a href="/recipes/users/178123/">Raymond Hettinger</a>
(<a href="/recipes/tags/concurrency_model/">concurrency_model</a>, <a href="/recipes/tags/cyclic_iterator/">cyclic_iterator</a>).
Revision 7.
</p>
<p>Solution to the Hamming Number problem. Demonstrates a lazy evaluation evaluation technique using itertools.tee() to feed an iterator into itself. This is a common technique with Haskell. The deferred_output() function is the key technique for implementing a forward reference to the output of the stream.</p>
Technique for cyclical iteration II (Python)
2010-01-20T03:54:15-08:00Jakub Wronieckihttp://code.activestate.com/recipes/users/4172837/http://code.activestate.com/recipes/577014-technique-for-cyclical-iteration-ii/
<p style="color: grey">
Python
recipe 577014
by <a href="/recipes/users/4172837/">Jakub Wroniecki</a>
(<a href="/recipes/tags/cyclic_iterator/">cyclic_iterator</a>, <a href="/recipes/tags/recursive_iterator/">recursive_iterator</a>).
</p>
<p>Inspired by this recipe: <a href="http://code.activestate.com/recipes/576961/" rel="nofollow">http://code.activestate.com/recipes/576961/</a>, I played a little with the code and came with a more general piece of code implementing recursive iterators.</p>