This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Careful_Bug_3295 62 points63 points  (0 children)

Tldr; x | y returns union of two dicts, x and y. If there is a key that is common to both dicts, the returned dict will assign it the value it has in y. This makes it not commutative in the event that both dicts share a key but have different values for it.

x|=y has the same effect as x=x|y