DEV Community

loading...

Discussion on: Python: Merging and Updating Dicts the New Way

Collapse
hanpari profile image
Pavel Morava

Not a lucky decision and design. The operator | is a union operation for sets, which is commutative operation.

Using for dicts breaks mathematics. It is as wrong as using + string concatenation.

Collapse
delta456 profile image
Swastik Baranwal Author

I don't know what to say. It's opinionated.

Collapse
hanpari profile image
Pavel Morava • Edited

No need to say anything 😁

I just wanted to point out why it might not be such a great idea.