Merging Python dictionaries with |: Right side wins conflicts

Merging Python dictionaries with |: Right side wins conflicts

Merge two Python dicts with | which returns a new dict. Conflicts? The right-side dict gets priority:

d1 = {'a':10, 'b':20, 'c':30}
d2 = {'b':100, 'c':200, 'd':300}

d1 | d2 # {‘a’: 10, ‘b’: 100, ‘c’: 200, ‘d’: 300}
d2 | d1 # {‘b’: 20, ‘c’: 30, ‘d’: 300, ‘a’: 10}