bpo-29816: Shift operation now has less opportunity to raise Overflow… · pythoncapi/cpython@918403c · GitHub
Skip to content

Commit 918403c

Browse files
bpo-29816: Shift operation now has less opportunity to raise OverflowError. (python#680)
ValueError always is raised rather than OverflowError for negative counts. Shifting zero with non-negative count always returns zero.
1 parent 762bf40 commit 918403c

3 files changed

Lines changed: 82 additions & 24 deletions

File tree

Lib/test/test_long.py

Lines changed: 30 additions & 2 deletions

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ What's New in Python 3.7.0 alpha 1?
1010
Core and Builtins
1111
-----------------
1212

13+
- bpo-29816: Shift operation now has less opportunity to raise OverflowError.
14+
ValueError always is raised rather than OverflowError for negative counts.
15+
Shifting zero with non-negative count always returns zero.
16+
1317
- bpo-24821: Fixed the slowing down to 25 times in the searching of some
1418
unlucky Unicode characters.
1519

Objects/longobject.c

Lines changed: 48 additions & 22 deletions

0 commit comments

Comments
 (0)