Popular recipes tagged "cyclic_iterator"http://code.activestate.com/recipes/tags/cyclic_iterator/2014-09-20T19:20:46-07:00ActiveState Code RecipesCycling a sequence (Python) 2014-09-20T19:20:46-07:00Tomas Nordinhttp://code.activestate.com/recipes/users/4189558/http://code.activestate.com/recipes/578942-cycling-a-sequence/ <p style="color: grey"> Python recipe 578942 by <a href="/recipes/users/4189558/">Tomas Nordin</a> (<a href="/recipes/tags/cyclic_iterator/">cyclic_iterator</a>, <a href="/recipes/tags/generator/">generator</a>, <a href="/recipes/tags/iterable/">iterable</a>, <a href="/recipes/tags/iterator/">iterator</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>A post-it function to cycle through some sequence. Better use itertools.cycle if for any iterable.</p> Technique 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>