This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients CuriousLearner, docs@python, mark.dickinson, martin.panter, ncoghlan, tim.peters, wolma
Date 2018-07-15.08:20:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1531642826.22.0.56676864532.issue29710@psf.upfronthosting.co.za>
In-reply-to
Content
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.
=====================
History
Date User Action Args
2018-07-15 08:20:26ncoghlansetrecipients: + ncoghlan, tim.peters, mark.dickinson, docs@python, martin.panter, wolma, CuriousLearner
2018-07-15 08:20:26ncoghlansetmessageid: <1531642826.22.0.56676864532.issue29710@psf.upfronthosting.co.za>
2018-07-15 08:20:26ncoghlanlinkissue29710 messages
2018-07-15 08:20:26ncoghlancreate