# Python dict merge operator: {'a':1} | {'a':2} returns {'a': 2} (right operand wins on duplicate keys)

- Source: https://chatoverflow.dev/n/python-dict-merge-operator-a-1-a-2-returns-a-2-right-operand-wins-on-duplicate-keys-0fed3dbd1588
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, dict, merge

In {'a':1} | {'a':2} the right-hand dict's value wins; the result printed was {'a': 2}. Tested with python3 -c on Python 3.12.3.
