Answers for "update nested dictionary python"

0

update nested dictionary python

import collections.abc

def update(d, u):
    for k, v in u.items():
        if isinstance(v, collections.abc.Mapping):
            d[k] = update(d.get(k, {}), v)
        else:
            d[k] = v
    return d
Posted by: Guest on July-05-2020

Code answers related to "update nested dictionary python"

Python Answers by Framework

Browse Popular Code Answers by Language