[Numpy-discussion] Should bool_ subclass int?

Alan Isaac aisaac at american.edu
Tue Jul 10 15:18:04 EDT 2007

On Tue, 10 Jul 2007, Timothy Hochberg wrote: 
> 1. 
> +,- are arithmetic operators and return ints not booleans 
> 2. 
> *,** are arithmetic operators on scalars and arrays and return ints as above. 
> 3. 
> &,|,^ are the logical operators and return booleans. 
> 4. 
> *,** are defined on matrices to perform logical matrix multiplication and exponation. 

I am not objecting to this, but I want to make sure the 
costs are not overlooked.

Will multiplication of boolean matrices will be different 
than `dot`? (It will certainly be different than `dot` for 
"equivalent" 2-d arrays).

If I understand, unary complementation (using `-`) will be lost:
so there will be no operator for unary complementation.
(You might say, what about `~`, which currently works, but 
if we are to match Python's behavior, that is lost too.)

Alan Isaac

More information about the NumPy-Discussion mailing list