Question about boolean types comparisons

Francesc Altet faltet at
Wed Oct 18 07:04:40 CDT 2006


I've seen that bool type in numpy seems to work more consistently than
its python counterpart:

In [28]:True+True
In [29]:numpy.bool_(True)+numpy.bool_(True)

Good! but...

In [30]:True > False
In [31]:numpy.bool_(True) > numpy.bool_(False)

Perhaps raising an error saying something like "boolean types cannot be
compared" would be nice. Not too important, but worth to notice, IMO.

>0,0<   Francesc Altet    |  Be careful about using the following code --
V   V   Carabos Coop. V.  |  I've only proven that it works, 
 "-"    Enjoy Data        |  I haven't tested it. -- Donald Knuth

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo

More information about the Numpy-discussion mailing list