[Numpy-discussion] precedence of '&' and '>' operators

Travis Oliphant oliphant at ee.byu.edu
Mon Mar 27 16:24:02 EST 2006


Michael Sorich wrote:

> It seems that the '&' operator has a higher precedence than a 
> comparison operator such as '>'. This does not seem so intuitive to 
> me. Is this correct?

Yes, this is correct.  See

http://docs.python.org/ref/summary.html

The problem really is that "and" (which has lower precedence) does not 
allow being over-written.  So, we must use the bit-wise operator.  



-Travis





More information about the NumPy-Discussion mailing list