[Python-checkins] bpo-39301: State that floor division is used for right shift operations (GH-20347) (GH-20416)

Miss Islington (bot) webhook-mailer at python.org
Tue May 26 04:34:08 EDT 2020


https://github.com/python/cpython/commit/b068d892c1ba7b996e43aceb974bfadac3c577ed
commit: b068d892c1ba7b996e43aceb974bfadac3c577ed
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-05-26T09:34:04+01:00
summary:

bpo-39301: State that floor division is used for right shift operations (GH-20347) (GH-20416)

* bpo-39301: State that floor division is used for right shift operations

* Remove "without overflow check"
(cherry picked from commit af7553ac95a96713be847dd45bc5a8aeb0a75955)

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

files:
M Doc/library/stdtypes.rst

diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index c4c4ccd76d5a7..c35cb2e11d32d 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -436,12 +436,10 @@ Notes:
    Negative shift counts are illegal and cause a :exc:`ValueError` to be raised.
 
 (2)
-   A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``
-   without overflow check.
+   A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``.
 
 (3)
-   A right shift by *n* bits is equivalent to division by ``pow(2, n)`` without
-   overflow check.
+   A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``.
 
 (4)
    Performing these calculations with at least one extra sign extension bit in



More information about the Python-checkins mailing list