{{ message }}
bpo-29816: Shift operation now has less opportunity to raise OverflowError.#680
Merged
serhiy-storchaka merged 7 commits intoMar 30, 2017
Merged
Conversation
…Error. ValueError always is raised rather than OverflowError for negative counts. Shifting zero with non-negative count always returns zero.
|
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mdickinson, @tim-one and @brettcannon to be potential reviewers. |
Sorry, something went wrong.
mdickinson
reviewed
Mar 20, 2017
mdickinson
reviewed
Mar 20, 2017
mdickinson
left a comment
Member
There was a problem hiding this comment.
Looks okay to me, but if feels a bit convoluted and hard to read / hard to verify. Why not use PyLong arithmetic in the overflow case, for example using divrem1 to extract the number of words / number of bits to shift?
Sorry, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.
ValueError always is raised rather than OverflowError for negative counts.
Shifting zero with non-negative count always returns zero.