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 docs@python, ncoghlan
Date 2020-01-11.06:59:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1578725984.98.0.631488660974.issue39301@roundup.psfhosted.org>
In-reply-to
Content
While reviewing ISO-IECJTC1-SC22-WG23's latest draft of their Python security annex, I noticed that https://docs.python.org/3.7/library/stdtypes.html#bitwise-operations-on-integer-types doesn't explicitly state that *floor* division is used for right shift operations, so right-shifting a negative number by more bits than it contains gives -1 rather than 0.

This is consistent with the way the language spec defines both binary right-shifts (as division by "pow(2, n)" and floor division (as rounding towards negative infinity), so this is just a documentation issue to note that we should make it clearer that this behaviour is intentional.
History
Date User Action Args
2020-01-11 06:59:45ncoghlansetrecipients: + ncoghlan, docs@python
2020-01-11 06:59:44ncoghlansetmessageid: <1578725984.98.0.631488660974.issue39301@roundup.psfhosted.org>
2020-01-11 06:59:44ncoghlanlinkissue39301 messages
2020-01-11 06:59:44ncoghlancreate