-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
more consistent findall output; fix #45495 #45538
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
Conversation
bump! |
bump |
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.
I think the correct behavior would be to return a Vector{eltype(collect(keys(A)))}
We currently get that wrong when we can infer a narrower type. This would fix the issue for concrete types but not for non-concrete types.
I won't make a value judgment on whether it is better to patch the common case now and leave a more obscure bug lurking or to wait until we get the behavior right in all cases.
Another possible solution is defining something like julia> Base._iterator_upper_bound(itr::Base.Generator) = itr.f(Base._iterator_upper_bound(itr.iter))
julia> Base._iterator_upper_bound(itr::Iterators.Filter) = Base._iterator_upper_bound(itr.itr)
julia> findall(x -> false, (1,2,3))
Int64[] I'm not sure it's worth making such a change though. |
As I understand from the @LilithHafner comment, this PR is in improvement, even though not perfect. Can this be merged as it is? |
bump... |
following @nalimilan's suggestion from #45495 discussion