[Pythonmac-SIG] precedence bug?

Mark Day mday@mac.com
Fri, 8 Feb 2002 17:24:11 -0800


On Friday, February 8, 2002, at 03:36  PM, Christopher Smith wrote:

> The python reference (ref/summary.html) it says that 'negation' and
> 'bitwise not' have higher precedence than exponentiation but this is =
not
> born out by the interpreter (MacPython 2.2):

I think you're reading the table wrong.  To quote that page:

> The following table summarizes the operator precedences=A0in Python, =
from=20
> lowest precedence (least binding) to highest precedence (most =
binding).

And note that exponentiation is listed *after* bitwise not and=20
negative.  That means that exponentiation has higher precedence (since=20=

it comes later in the table).

-Mark