You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a continuation of the disussion with @seberg in #3501, along with #3502:
Lots of places (such as 1, 2) use PyArray_Type->tp_as_number->nb_multiply to call the multiply ufunc (etc.). Because of __array_priority__, the semantics of nb_multiply are no longer the same as the ufunc. Specifically, nb_multiply is required to to return NotImplemented in cases of priority inversion, whereas the ufunc has a job to do and just needs to do it, without asking questions about priorities.
EDIT (seberg): This is still the case and probably cause of a few bugs (I am very sure reading an issue recently). It shouldn't be hard to fix, we have the nb_ops or mapping that is used for the array object: That needs to used throughout for scalartypes.c.src and scalarmath.c.src would do so indirectly then, although directly might solve additional unnecessary dances.
Activity
inducer commentedon Jul 5, 2013
See here for a comment explaining how I got bitten by this.
seberg commentedon Nov 29, 2024
I actually think there are no remaining oddities left here. (At least
nb_multiplyandnb_addare not used explicitly anymore).