Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-86069: Do not ignore the third argument in slot_nb_inplace_power()#130225
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
gh-86069: Do not ignore the third argument in slot_nb_inplace_power()#130225
Conversation
…ower()The default implementation of the nb_inplace_power slot no longerignores the third argument, but passes it to the __ipow__ methodif its value is not None.
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.
This looks fine from the technical side, but I'm not sure if this is a good idea.
- Apparently, this 3-arg form isn't used somewhere for years.
- There is no way to invoke this from pure-Python. Do we have some in-place shortcut for this stuff in some other language?
- PyNumber_InPlacePower() still wrong: "The operation is done in-place when o1 supports it. This is the equivalent of the Python statement o1 **= o2 when o3 isPy_None, or an in-place variant of pow(o1, o2, o3) otherwise." There is no in-place variant of pow().
IMO, better to drop the module argument from__ipow__()
.
Yes, this is hypothetical in-place variant of pow(). If there was some function, it would be used in the documentation. The current behavior is inconsistent. If |
Uh oh!
There was an error while loading.Please reload this page.
The default implementation of the nb_inplace_power slot no longer ignores the third argument, but passes it to the
__ipow__
method if its value is not None.