Skip to content

Instantly share code, notes, and snippets.

@dplepage
Created August 6, 2014 19:38
Show Gist options
  • Save dplepage/d0a1557bef40be4d14fa to your computer and use it in GitHub Desktop.
Save dplepage/d0a1557bef40be4d14fa to your computer and use it in GitHub Desktop.
def overlay(d1, d2):
for key, value in d2.items():
if isinstance(value, dict) and isinstance(d1.get(key), dict):
overlay(d1[key], value)
else:
d1[key] = value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment