Guido van Rossum wrote:
I guess this explains the behavior of removing results <= 0; it makes sense as multiset subtraction, since in a multiset a negative count makes little sense. (Though the name Counter certainly doesn't seem to imply multiset.)

It doesn't even behave consistently as a multiset, since c[k] -= n
is happy to let the value go negative.

For sets, union and intersection are distributive over each other.

Note that this is *not* the case for + and * when used with (mathematical) numbers... So in a sense, SETL (which uses + and *
> for union and intersection got the operators wrong.

But in another sense, it didn't. In Boolean algebra, "and" and "or"
(which also distribute over each other) are often written using the
same notations as multiplication and addition. There's no rule in
mathematics saying that these notations must be distributive in one
direction but not the other.

--
Greg
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to