Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python method for fetching deeply nested dict keys à la ImmutableJS.getIn
def deep_get(o, keys):
return reduce(lambda prev, current: prev.get(current, {}), keys, o) or None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment