-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
bpo-37893: raise ValueError in pow if exponent is negative and modulus is +-1 #15344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Added a comment about what appears to be a logic error.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I've already commented on the issue, but for the record I'm (quite strongly) opposed to changing this. It's perfectly correct as it is. |
I have made the requested changes; please review again |
Thanks for making the requested changes! @tim-one: please review the changes made to this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again! However, on the bpo report, Mark is opposed to this change, so I expect we'll have to abandon this. Sorry for the hassle!
I'm closing this, since Mark gave a good case for leaving it alone. Thank you for the effort! |
Check modulus and the exponent and if there is a case like exponent is negative and abs(modulus) is 1, raise a ValueError
https://bugs.python.org/issue37893