Skip to content

Instantly share code, notes, and snippets.

@tthsqe12
Created Sep 16, 2022
Embed
What would you like to do?
oh no
julia> x = [1,2,3]
3-element Vector{Int64}:
1
2
3
julia> d = Dict{Vector{Int}, Int}(x => 1)
Dict{Vector{Int64}, Int64} with 1 entry:
[1, 2, 3] => 1
julia> x[3] = 4
4
julia> d
Dict{Vector{Int64}, Int64} with 1 entry:
[1, 2, 4] => 1
julia> d[[1,2,3]]
ERROR: KeyError: key [1, 2, 3] not found
Stacktrace:
[1] getindex(h::Dict{Vector{Int64}, Int64}, key::Vector{Int64})
@ Base ./dict.jl:481
[2] top-level scope
@ REPL[7]:1
julia> d[[1,2,4]]
ERROR: KeyError: key [1, 2, 4] not found
Stacktrace:
[1] getindex(h::Dict{Vector{Int64}, Int64}, key::Vector{Int64})
@ Base ./dict.jl:481
[2] top-level scope
@ REPL[8]:1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment