Skip to content

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

Closed
wants to merge 2 commits into from

Conversation

isidentical
Copy link
Member

@isidentical isidentical commented Aug 20, 2019

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

Copy link
Member

@tim-one tim-one left a 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.

@bedevere-bot
Copy link

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 have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@mdickinson
Copy link
Member

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.

@isidentical
Copy link
Member Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@tim-one: please review the changes made to this pull request.

Copy link
Member

@tim-one tim-one left a 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!

@tim-one
Copy link
Member

tim-one commented Aug 20, 2019

I'm closing this, since Mark gave a good case for leaving it alone. Thank you for the effort!

@tim-one tim-one closed this Aug 20, 2019
@isidentical isidentical deleted the bpo-37893 branch October 12, 2019 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants