-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Revert "Fix broadcast_indices (#22130)" & add test for issue #22180
Conversation
test/broadcast.jl
Outdated
@@ -419,7 +419,6 @@ struct Array19745{T,N} <: AbstractArray{T,N} | |||
data::Array{T,N} | |||
end | |||
Base.getindex(A::Array19745, i::Integer...) = A.data[i...] | |||
Base.setindex!(A::Array19745, v::Any, i::Integer...) = setindex!(A.data, v, i...) |
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.
Can you split the example into two parts rather than changing it back? It's useful to test implementations that override setindex!
.
So at least now I understand why you changed this. Still, telling people to override |
I think that would be okay if we in return get a more extensible design for |
Yes, I don't mind breaking things if that allows defining a better API that will remain stable after that. But here we just rename functions without a clear global picture for 1.0 AFAICT (see #20740). |
This reverts commit fb81c34. And adds a test for the bug this causes.
Yeah, I didn't really investigate that. But as counterpoint, you only should be overriding this method if you also override
It's already broken just trying to use broadcast without packages, as demonstrated by the test added herein. I don't have any perspective on the global picture for this API in the future, I just know that this is a simple fix for a case that is broken now. We can review and hope for a more elegant solution in the future, but I don't agree that should hold up a simple-enough bug fix in the present design. |
Except that it looks like we'd better rename
Well, Isn't there a way to fix this while still keeping |
No, you can't give two different functions the same name |
I think we should swap the two function names... This can't be deprecated and however would simply break code. |
That still breaks DataArrays (packages that define _broadcast_indices also need to call broadcast_indices), but seems like it would be less consistent within the current API. |
Then can we just hold off merging this for a while and try to figure what the final design will look like in the meantime? E.g. we might want to rename |
Adding the decision label since a decision is needed on the design. Should we split the design discussion into a separate issue and/or Julep? |
Ref. #20740 |
Bump. We need to figure out how to move forward here. |
Comments on the proposal I made in my last comment ? |
That proposal sounds reasonable to me |
Redundant with #23939 |
Yay! |
This reverts commit fb81c34 from #22130.
And adds a test for the bug this causes.