-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
In-place operators in 1.9 "respected" __array_priority__; in current master they don't #6020
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
Oh, I think I know what's going on: in 1.9, |
Hmm, the case of a non-array is also the only one for which I think support for raising
In more-or-less current master, one gets
I don't particularly mind this eventually becoming impossible, but it seems a bit pointless to force a change now, when we're otherwise continuing to support the old |
I have a use-case very similar to @mhvk's demo there (actually a different unit package, with the same type of behavior). I actually just discovered If |
@mhvk I haven't been following this or related threads, but is that a typo? Should it be either |
@agriffing: he meant return NotImplemented.
|
@argriffing - yes, returning @njsmith - bit nitpicky, but I'd leave the deprecation warning outside of this issue at least; even though I agree it is risky usage, I think it should be added only when we start deprecating |
@mhvk: hmm, my reasoning is, this isn't a deprecation of
|
I may be weird and accidental behaviour that might well be counted on.... It also strikes to one of the main points in the long discussion in #5844, where there was a lot of arguing that for non-array classes, one should just default to standard python logic. If at all possible, I think we should just fix the regression here, and discuss possible deprecation warnings in #6001. |
I agree with Martin here |
I'm fine with not deprecating But I don't want to block anything further for that, so tell you what -- as soon as #6001 gets some resolution, I'll post a PR that just restores the 1.9 behavior, and then we can have a whole separate, focused discussion about what to do with (Unfortunately I can't post a PR fixing this immediately because I just tried, and discovered it'd have massive conflicts with #6001. So we're waiting on #6001. Fortunately this should only take a few minutes to sort out once #6001 gets resolved.) |
OK, this looks like the only thing really blocking 1.11. We should make a decision here, even though 1.10 is already out. |
Well, obviously the walls didn't come tumbling down when this regression hit 1.10, though on the other hand it is unclear what fraction of the numpy users is now using 1.10 (e.g., it landed in Debian testing only a few days ago). Overall, I'd still prefer there to be at least one way for ensuring
|
The issue here is a case where we're silently converting inplace ops into out of place ops, which is really inconsistent with numpy's general philosophy (unnumpythonic?). I was fine with deferring that discussion until later, and we definitely should have done a standard deprecation period once we got around to it. But now it appears that we've gone ahead and shipped the fixed behavior in 1.10, and no one noticed. Oops. That's unfortunate, but given this, I'm not really excited about the idea of adding back the broken behavior in 1.11 just so we can deprecate it and remove it again later. Either way, it's not going to be something that downstream packages can count on; changing it now just creates more churn IMO. (Also, delaying the release because of last minute things like this is just an unfortunate pattern to get into. If no one brought it up during the whole 1.11 cycle, then maybe it can wait until 1.12? That's only a few months away in the new scheme.) |
OK, lets kick this can further down the road. We need to get back to the whole |
Yes, fine by me; I'll probably continue to argue for having an option to tell |
Feels like this might still be true, but with the implementation and adoption of |
@seberg - yes, correct to close; for reference for anyone who stumbles on this: the way to tell numpy to not be greedy is to define |
In 1.9.2:
But in current master:
This is because:
I'm pretty sure this is due to #5964 / #5864, i.e., my fault, doh. Though I'm not sure how, exactly; e.g. @pv caught that there was potentially an issue here but then decided it actually only affected object arrays, so right now I'm not even 100% sure that this is the responsible change or what exactly happened. Some careful analysis is needed.
I think the behaviour in master is probably correct, but it could break people's code. So options:
DeprecationWarning
in 1.10, error in 1.11.And if we go with the latter option, then we have to figure out exactly which cases should return
NotImplemented
and issue the warning.This doesn't need to block 1.10 alpha, but it does need some sort of decision before 1.10 final, so I'll tag it with the milestone.
The text was updated successfully, but these errors were encountered: