Created
August 6, 2014 19:38
-
-
Save dplepage/d0a1557bef40be4d14fa to your computer and use it in GitHub Desktop.
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
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