Open this example in the interactive library
Source code
record = {'name': 'Al', 'note': 'ready', 'rank': 4}
patch = {'note': None, 'rank': 0}
updated = {key: patch.get(key, val) for key, val in record.items()}
print(updated)
Sample output
{'name': 'Al', 'note': None, 'rank': 0}