Eric Firing wrote: > That makes sense, and implies that the real solution would be the > introduction of operators && and || into Python, or a facility that > would allow extensions to add operators. I guess it would be a matter > of having hooks into the parser. I have no idea whether either of these > is a reasonable goal--but it certainly would be a big plus for Numpy.
I don't really see how. We already have the & and | operators. The only difference between them and the && and || operators would be that the latter would automatically coerce to boolean arrays. But you can do that explicitly, now. a.astype(bool) | b.astype(bool) Of course, it's highly likely that you are applying & and | to arrays that are already boolean. Consequently, I don't see a real need for more operators. But if you'd like to play around with the grammar: http://www.fiber-space.de/EasyExtend/doc/EE.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco 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 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion