Nick Coghlan <ncogh...@gmail.com> added the comment:
OK, that makes sense to me. Given that, there'd be two changes proposed. 1. Replace the opening paragraph of https://docs.python.org/3/library/stdtypes.html#bitwise-operations-on-integer-types (the one I originally quoted when opening this issue) with the text: ===================== Bitwise operations only make sense for integers. The result of bitwise operations is calculated as though carried out in two's complement with an infinite number of sign bits. ===================== 2. Add a new footnote ``(4)`` to the table for the ``|``, ``^``, and ``&`` entries that reads: ===================== 4. Performing these calculations with at least one extra sign extension bit in the internal representation (a working bit-width of ``1 + max(x.bit_length(), y.bit_length()`` or more) is sufficient to get the same result as if there were an infinite number of sign bits. ===================== ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue29710> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com