Question about boolean types comparisons

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


Hi,

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

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

Good! but...

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

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
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642




More information about the Numpy-discussion mailing list