Popular recipes tagged "recursive_iterator"http://code.activestate.com/recipes/tags/recursive_iterator/popular/2011-12-23T22:10:38-08:00ActiveState Code RecipesRecursively walk Python objects (Python)
2011-12-23T22:10:38-08:00Yaniv Akninhttp://code.activestate.com/recipes/users/4180246/http://code.activestate.com/recipes/577982-recursively-walk-python-objects/
<p style="color: grey">
Python
recipe 577982
by <a href="/recipes/users/4180246/">Yaniv Aknin</a>
(<a href="/recipes/tags/container/">container</a>, <a href="/recipes/tags/recursive/">recursive</a>, <a href="/recipes/tags/recursive_iterator/">recursive_iterator</a>, <a href="/recipes/tags/walk/">walk</a>).
Revision 2.
</p>
<p>A small function that walks over pretty much any Python object and yields the objects contained within (if any) along with the path to reach them. I wrote it and am using it to validate a deserialized data-structure, but you can probably use it for many things.</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>