.. function:: and_(a, b)
__and__(a, b)
- Return the bitwise and of *a* and *b*.
+ Return ``a & b``.
.. function:: floordiv(a, b)
__inv__(obj)
__invert__(obj)
- Return the bitwise inverse of the number *obj*. This is equivalent to ``~obj``.
+ Return ``~obj``.
.. function:: lshift(a, b)
__lshift__(a, b)
- Return *a* shifted left by *b*.
+ Return ``a << b``.
.. function:: mod(a, b)
.. function:: mul(a, b)
__mul__(a, b)
- Return ``a * b``, for *a* and *b* numbers.
+ Return ``a * b``.
.. function:: matmul(a, b)
.. function:: or_(a, b)
__or__(a, b)
- Return the bitwise or of *a* and *b*.
+ Return ``a | b``.
.. function:: pos(obj)
__pos__(obj)
- Return *obj* positive (``+obj``).
+ Return ``+obj``.
.. function:: pow(a, b)
__pow__(a, b)
- Return ``a ** b``, for *a* and *b* numbers.
+ Return ``a ** b``.
.. function:: rshift(a, b)
__rshift__(a, b)
- Return *a* shifted right by *b*.
+ Return ``a >> b``.
.. function:: sub(a, b)
.. function:: xor(a, b)
__xor__(a, b)
- Return the bitwise exclusive or of *a* and *b*.
+ Return ``a ^ b``.
Operations which work with sequences (some of them with mappings too) include:
+-----------------------+-------------------------+---------------------------------------+
| Division | ``a // b`` | ``floordiv(a, b)`` |
+-----------------------+-------------------------+---------------------------------------+
-| Bitwise And | ``a & b`` | ``and_(a, b)`` |
+| Bitwise And, or | ``a & b`` | ``and_(a, b)`` |
+| Intersection | | |
+-----------------------+-------------------------+---------------------------------------+
-| Bitwise Exclusive Or | ``a ^ b`` | ``xor(a, b)`` |
+| Bitwise Exclusive Or, | ``a ^ b`` | ``xor(a, b)`` |
+| or Symmetric | | |
+| Difference | | |
+-----------------------+-------------------------+---------------------------------------+
-| Bitwise Inversion | ``~ a`` | ``invert(a)`` |
+| Bitwise Inversion, or | ``~ a`` | ``invert(a)`` |
+| Complement | | |
+-----------------------+-------------------------+---------------------------------------+
-| Bitwise Or | ``a | b`` | ``or_(a, b)`` |
+| Bitwise Or, or | ``a | b`` | ``or_(a, b)`` |
+| Union | | |
+-----------------------+-------------------------+---------------------------------------+
| Exponentiation | ``a ** b`` | ``pow(a, b)`` |
+-----------------------+-------------------------+---------------------------------------+