Skip to content

Instantly share code, notes, and snippets.

@jsatt
jsatt / deep_merge.py
Last active August 26, 2020 14:38 — forked from yatsu/deep_merge.py
Python dict deep merge
from copy import deepcopy
from functools import reduce
def merge_dicts(dict1: dict, dict2: dict) -> dict:
"""
Merges dicts.
"""
for key in dict2:
if key not in dict1 or not isinstance(dict1[key], dict):