Skip to content

Instantly share code, notes, and snippets.

@pudquick
Created December 30, 2013 20:14
Show Gist options
  • Save pudquick/8187480 to your computer and use it in GitHub Desktop.
Save pudquick/8187480 to your computer and use it in GitHub Desktop.
def match_dict(list_of_dicts_to_search, matching_dict):
for a_dict in list_of_dicts_to_search:
if all(map(lambda x: a_dict.get(x[0], None) == x[1], matching_dict.items())):
return a_dict
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment