GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — 5.8 Binary bit-wise operations

Previous Page Up One Level Next Page Python Reference Manual Contents Index
Previous: 5.7 Shifting operations Up: 5. Expressions Next: 5.9 Comparisons


5.8 Binary bit-wise operations

Each of the three bitwise operations has a different priority level:

and_expr:       shift_expr | and_expr "&" shift_expr
xor_expr:       and_expr | xor_expr "^" and_expr
or_expr:       xor_expr | or_expr "|" xor_expr

The & operator yields the bitwise AND of its arguments, which must be plain or long integers. The arguments are converted to a common type.

The ^ operator yields the bitwise XOR (exclusive OR) of its arguments, which must be plain or long integers. The arguments are converted to a common type.

The | operator yields the bitwise (inclusive) OR of its arguments, which must be plain or long integers. The arguments are converted to a common type.


Previous Page Up One Level Next Page Python Reference Manual Contents Index
Previous: 5.7 Shifting operations Up: 5. Expressions Next: 5.9 Comparisons

See About this document... for information on suggesting changes.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.