-
Notifications
You must be signed in to change notification settings - Fork 2
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
All the getindex
implementations should use view
, not slice
#26
Comments
hmm, I'm pretty sure you're not supposed to make a default slice "view" |
This is what I'm seeing, with the concrete julia> original = Vector([1.1, 2.2, 3.3, 4.4, 5.5])
5-element Vector{Float64}:
1.1
2.2
3.3
4.4
5.5
julia> sliced = original[2:4]
3-element Vector{Float64}:
2.2
3.3
4.4
julia> viewed = view(original, 2:4)
3-element view(::Vector{Float64}, 2:4) with eltype Float64:
2.2
3.3
4.4
julia> original[3] = 9999
9999
julia> sliced
3-element Vector{Float64}:
2.2
3.3
4.4
julia> viewed
3-element view(::Vector{Float64}, 2:4) with eltype Float64:
2.2
9999.0
4.4 Oh, but maybe this means that the AwkwardArray (In Python, |
you don't need to add view override yourself. All You can use |
I just noticed that slices copy! They were supposed to be views.
The text was updated successfully, but these errors were encountered: