Last active
November 20, 2016 19:39
-
-
Save neotheicebird/d6b3b79f5fc9744f66bef681b6c63507 to your computer and use it in GitHub Desktop.
Get item contained in depths of nested dicts, using a list of keys. If a valid item cant be found, returns a None
This file contains 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
# get only the first element | |
checkout_curse = reduce(lambda curses_dict, key: dict.get(key), [curses_dict, "curses", "names", 0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment