[SciPy-dev] array logical ops error?

Alan G Isaac aisaac at american.edu
Tue Nov 1 06:48:40 CST 2005


On Tue, 1 Nov 2005, Ed Schofield apparently wrote: 
> Hmmm.  Could we somehow get "b and c" to return a simple 
> boolean rather than an array of booleans?  This would be 
> more consistent.  At the moment it's totally mad: "b and 
> c" is different to "c and b" ;) 

You're just getting back c in the first case and b in the 
second case, as "expected" (once reminded of this Python 
behavior).  You can look at bool(b and c) and get the right 
result.

fwiw,
Alan Isaac






More information about the Scipy-dev mailing list