-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-91117: Ensure integer mod and pow operations use cached small ints #31843
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
I found the call graph of function names a lot to juggle, but the relevant call graphs are like this:
As I noted in the issue,
|
@sweeneyde Sorry Dennis. This is on my list of things to review, but I'm not likely to get to it for a few days. |
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.
LGTM!
@@ -2732,6 +2733,7 @@ long_rem(PyLongObject *a, PyLongObject *b, PyLongObject **prem) | |||
else { | |||
/* Slow path using divrem. */ | |||
Py_XDECREF(x_divrem(a, b, prem)); | |||
*prem = maybe_small_long(*prem); |
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.
It surprised me initially that it was okay to call maybe_small_long
on a value that might be NULL
, but I see that other parts of Objects/longobject.c
also do that (and it makes sense from a convenience perspective).
Thanks for the review! Looks like we should wait for Blurb-It to sign its CLA ;) |
I think we can reasonably bypass that. Feel free to merge! |
https://bugs.python.org/issue46961