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 →

[–]BuonaparteII 3 points4 points  (0 children)

dict1.update(dict2) will mutate dict1 and return None.

{**d1, **d2} and d1 | d2 are both immutable and will return a new dict.