[Numpy-discussion] Should bool_ subclass int?
aisaac at american.edu
Tue Jul 10 15:18:04 EDT 2007
On Tue, 10 Jul 2007, Timothy Hochberg wrote:
> +,- are arithmetic operators and return ints not booleans
> *,** are arithmetic operators on scalars and arrays and return ints as above.
> &,|,^ are the logical operators and return booleans.
> *,** 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.)
More information about the NumPy-Discussion