[Numpy-discussion] Deprecate boolean math operators?

Alexander Belopolsky ndarray at mac.com
Fri Dec 6 12:23:23 EST 2013


On Fri, Dec 6, 2013 at 11:13 AM, Alan G Isaac <alan.isaac at gmail.com> wrote:

> On 12/5/2013 11:14 PM, Alexander Belopolsky wrote:
> > did you find minus to be as useful?
>
>
> It is also a correct usage.
>
>
Can you provide a reference?



> I think a good approach to this is to first realize that
> there were good reasons for the current behavior.
>
>
Maybe there were, in which case the current behavior should be documented
somewhere.

What is the rationale for this:

>>> -array(True) + array(True)
True

?

I am not aware of any algebraic system where unary minus denotes anything
other than additive inverse.

Having bools form a semiring under + and * is a fine (yet somewhat unusual)
choice, but once you've made that choice you loose subtraction because True
+ x = True no longer has a unique solution.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20131206/44173195/attachment.html>


More information about the NumPy-Discussion mailing list