r/Python • • Sep 15 '20

Resource Python 3.9: All You need to know 👊

https://ayushi7rawat.hashnode.dev/python-39-all-you-need-to-know
1.2k Upvotes

204 comments sorted by

View all comments

Show parent comments

1

u/ianliu88 Sep 16 '20

I only pointed out the fact that {**a, **b} isn't a union operation, as stated by the previous comment. It is a dict update, and it is expected for it not to be commutative.

1

u/stevenjd Sep 17 '20

Dict unions are not expected to be commutative either. If a key exists in both operands, they can have two distinct values, but the union can only pick one of them.