Skip to content

Instantly share code, notes, and snippets.

Pavel Brodsky mcouthon

Block or report user

Report or block mcouthon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mcouthon
mcouthon / dict_merge.py
Created Sep 7, 2017 — forked from angstwad/dict_merge.py
Recursive dictionary merge in Python
View dict_merge.py
import collections
def dict_merge(dct, merge_dct):
""" Recursive dict merge. Inspired by :meth:``dict.update()``, instead of
updating only top-level keys, dict_merge recurses down into dicts nested
to an arbitrary depth, updating keys. The ``merge_dct`` is merged into
``dct``.
:param dct: dict onto which the merge is executed
:param merge_dct: dct merged into dct
You can’t perform that action at this time.