[Numpy-discussion] Should bool_ subclass int?
Alan G Isaac
Tue Jul 10 09:36:55 CDT 2007
I found Gael's presentation rather puzzling for two reasons.
1. It appears to contain a `+` vs. `*` confusion.
2. MUCH more importantly:
In implementations of TWO, we interpret `-` as unary
complementation (not e.g. as additive inverse; note True
does not have one). So
-True is False
-False is True
This matches numpy:
This is a GOOD THING.
However, a-b should then just be shorthand for a+(-b).
Here numpy does not in my opinion behave correctly:
The second answer is the right one, in this context.
I would call this second answer a bug.
More information about the Numpy-discussion