InvertedIndices.jl
InvertedIndices.jl copied to clipboard
Should InvertedIndices call `to_indices` on all elements in an array of skipped indices?
We have the following super bad behavior:
julia> [1, 2, 3, 4][Not(Not([1.5]))]
1-element Vector{Int64}:
2
julia> [1, 2, 3, 4][Not(Not([1.5]))]
1-element Vector{Int64}:
0
julia> [1, 2, 3, 4][Not(Not([1.5]))]
1-element Vector{Int64}:
4294967297
which is a consequence of the fact that:
to_index(I::AbstractArray) = I
in Base.
@mbauman - do you think we should fix it in InvertedIndices.jl or this should be fixed in Base?
CC @nalimilan
Another issue with Not:
julia> x = [1, 2, 3]
3-element Vector{Int64}:
1
2
3
julia> x[Not(Integer[true, 2])]
1-element Vector{Int64}:
3
and this should error