Skip to content

Instantly share code, notes, and snippets.

@pando85
pando85 / merge_dict.py
Last active February 11, 2020 08:59
Python deep merge dict
import pytest
def merge_dict(a, b):
for key in b:
if key in a:
if isinstance(a[key], dict) and isinstance(b[key], dict):
merge_dict(a[key], b[key])
elif a[key] == b[key]:
pass