Skip to content

Instantly share code, notes, and snippets.

@tthsqe12
Created September 16, 2022 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tthsqe12/bc8faa618c3ebdc0621511a4c040bf13 to your computer and use it in GitHub Desktop.
Save tthsqe12/bc8faa618c3ebdc0621511a4c040bf13 to your computer and use it in GitHub Desktop.
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