This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
http://code.activestate.com/recipes/577982-recursively-walk-python-objects/ | |
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. | |
Example use: In one configuration mechanism I implemented, there exists an | |
UNCONFIGURED sentinel that marks configuration items that are required but |