funcy
funcy copied to clipboard
Dict deep merge?
Is there a way to deep merge a dict?
From the top of my head:
from funcy import join_with, all, is_mapping
def deepmerge(*dicts):
return join_with(deepmerge, dicts) if all(is_mapping, dicts) else dicts[-1]