News for hackers. Stuff that matters.
Re:PEP 584 – Add + and – operators to the built-in dict class by dtech on Wednesday March 06, 2019 @05:46AM (#19317916)
> It's always been on my Python wish list that dicts would subclass sets, as dicts are essentially sets with values attached.

> There's no reason you shouldn't have always been able to say d | d2, same as sets.

I don't agree with this view, mainly because merging a dict is not associative, while unionizing a set is.

The actual operation for "a + b" is "add everything from b set to a", and + more closely resembles that than |.

There are no comments on this comment yet.