-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Ufunc overrides should always raise TypeError if any arguments set __array_ufunc__ = None #9011
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
I'm still not sure I entirely agree with this: at least my original intention was for |
@mhvk There wasn't a formal vote, but my impression was that the majority thought is should simply raise a TypeError in this situation. In practice, I doubt it will make much difference, so the simplest behavior has much to recommend it. The use of big |
@mhvk: Consider (Well, I guess if |
In current master, if Here, I think part of the differences arises from my feeling that the ufunc module should effectively be more like |
Continuing on the above: there is no direct precedent from python, but I think one should treat In the end, I do think it boils down to the question of whether one treats the ufunc module as a standard interface that numpy provides to evaluate mathematical functions, i.e., whether as I suggested above it is similar to |
As noted in #9014, I'd still prefer sticking with what we have, but definitely do not feel very strongly about it. So, fine to go with the stricter rules. |
Following up on our discussion in #8247 (comment), we need to switch ufunc overrides to always raise
TypeError
if any arguments set__array_ufunc__ = None
. The avoids potential for confusion withx + y
andnp.add(x, y)
yielding different results.This is a blocker for the 1.13.0 release.
The text was updated successfully, but these errors were encountered: