-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Unexpected behavior for **=
when __numpy_ufunc__
is present.
#7146
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
Comments
The FWIW in the particular case of in-place operators, I feel strongly that (NB that it will of course be possible to override these via the |
Thanks for this. I definitely agree with you that in-place operators should not fall back on out-of-place. I'll be interested to see how this develops. Given the instability of this I'll abandon my efforts to use it for now. |
I've been working on getting Pint ready for the new
__numpy_ufunc__
functionality, but I've run into a snag.I've done my best to document the issue in this gist. In particular, the issue is that when creating classes that are not
ndarray
, I can reproduce expected behavior using standard python special operators (e.g.__add__
) when__numpy_ufunc__
is present. For example,myobj.__radd__
is called when I doan_ndarray += myobj
. However,myobj.__rpow__
is not called when I doan_ndarray **= myobj
. Can anyone explain to me why this is? Thanks.This issue has arisen from this one: hgrecco/pint#326.
The text was updated successfully, but these errors were encountered: