Walking Nested Dictionaries in Python

Python

Video is ready, Click Here to View ×


This simple trick is going to speed up any future functions I write that require pulling items out of a JSON response.

7 thoughts on “Walking Nested Dictionaries in Python

  1. Thx so much. This example works with python2 however with the changes to python3 I don't think it does. When trying to apply the walkdict example, I was unable to create a stack from obj.items() because python3 returns a view from the .items() method
    In python2 you were dealing with a copy of the obj… (could be wrong, still a bit fuzzy on whats going wrong).
    This is still the best example of how to deal with complex data structures I have found, I think there must be some way to treat the object as a stack and perform similar operations on it in python3, but I am certainly missing it.

Leave a Reply

Your email address will not be published. Required fields are marked *