You should have a look at old PEP225 "Elementwise operators", that proposed ~
as a modifier for many existing operator, to indicate they do mostly what their
"normal counterpart do, but act on the inner/ elements of an object instead of
on the whole.
This was only a memorisation technique, as all tilde operators were defined
individually and has associated magic/dunder method (they had also the same
precedence as the non-tilded version). It was mainly for ~* to be used as
classic numpy multiply and * used as matrix multiply, but as an aside, ~and,
~or, ~not and ~xor were defined as elementwise logical operators, bitwise when
applied on int-like objects.
Also xor was proposed as a new short-circuiting
Classic operator, for orthogonality (the value returned when doing true_a xor
true_b was not fixed in the PEP, I can not decide between False and None ;-)
Funny this come back after all this time
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/