On Wed, Dec 25, 2019, 9:11 PM python-ideas--- via Python-ideas < [email protected]> wrote:
> On the contrary, on sets you can apply union *and* difference. And since > union seems the exact contrary of difference, it's illogical that | is used > instead of +. Set union is self-evidently NOT the inverse operation of set difference. It's not merely not an obvious analogy, it's simply wrong. If we had a multi-set type (collections.Counter is close, but not exact), then there would be something close to an inverse of set difference. But that's not the type Python provides (nor should it as a built-in). Set union, however, has a great deal in common with bitwise-or, so using the same symbol is intuitive.
_______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/NROTYYXINRI56FHBLXTY3DXOBEADBKKL/ Code of Conduct: http://python.org/psf/codeofconduct/
