[Python-bugs-list] [ python-Bugs-471202 ] bit shift operator << precedence

noreply@sourceforge.net noreply@sourceforge.net
Mon, 15 Oct 2001 06:36:49 -0700


Bugs item #471202, was opened at 2001-10-14 21:01
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=471202&group_id=5470

Category: Parser/Compiler
Group: Python 2.1.1
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: bit shift operator << precedence

Initial Comment:
In 2.1.1, 
It appears bit shift operator << has lower precedence than operator +. Expression 1<<16 + 1 
results in 131072 rather than the expected 65537. User has to use (1<<16) +1 to get the 
expected result.



----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2001-10-15 06:36

Message:
Logged In: YES 
user_id=6380

Alas, Python doesn't yet parse whitespace in expressions.
:-)

According to the Python reference manual, << has indeed
lower precedence than +, so this is not a bug.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=471202&group_id=5470