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-14.13:09:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I think we have a fairly different notion of what clarity means here - I have no mental concept whatsoever of how to do two's complement arithmetic with an infinite number of sign bits (I learned most of what I know about two's complement by working with fixed point 16-bit and 32-bit microprocessors), so the infinite bits explanation provides me with very little useful insight, whereas I can readily cope with the notion of storing a single extra sign extension bit beyond the minimum required to hold the operands' two's complement representations.

That said, I do like the idea of using infinite precision arithmetic as the formal definition of the intended language semantics, which would lead to wording like the following:

Each bitwise operation has the same result as though carried out in two's complement with an infinite number of sign bits. In practice, performing the calculation with one extra sign extension bit (a bit-width of ``1 + max(x.bit_length(), y.bit_length()``) is sufficient to get the expected result.
Date User Action Args
2018-07-14 13:09:01ncoghlansetrecipients: + ncoghlan, tim.peters, mark.dickinson, docs@python, martin.panter, wolma, CuriousLearner
2018-07-14 13:09:01ncoghlansetmessageid: <>
2018-07-14 13:09:01ncoghlanlinkissue29710 messages
2018-07-14 13:09:01ncoghlancreate