Improve docstring for deep_merge_dicts

This commit is contained in:
Matthias 2019-06-09 14:04:19 +02:00
parent d7c63347e1
commit 9c497bf15c
1 changed files with 2 additions and 0 deletions

View File

@ -117,6 +117,8 @@ def format_ms_time(date: int) -> str:
def deep_merge_dicts(source, destination):
"""
Values from Source override destination, destination is returned (and modified!!)
Sample:
>>> a = { 'first' : { 'rows' : { 'pass' : 'dog', 'number' : '1' } } }
>>> b = { 'first' : { 'rows' : { 'fail' : 'cat', 'number' : '5' } } }
>>> merge(b, a) == { 'first' : { 'rows' : { 'pass' : 'dog', 'fail' : 'cat', 'number' : '5' } } }