From 2dad9583523205a64c9452245fa5ea89bec7efe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogumi=C5=82=20Kami=C5=84ski?= Date: Tue, 21 Nov 2017 17:54:39 +0100 Subject: [PATCH] remove rehash! from Dict constructor (#24345) --- base/dict.jl | 18 +++++++----------- base/precompile.jl | 42 +++++++++++++++++++++--------------------- test/dict.jl | 8 ++++++++ 3 files changed, 36 insertions(+), 32 deletions(-) diff --git a/base/dict.jl b/base/dict.jl index 67f8fbfd98d34..1f8be1c375aee 100644 --- a/base/dict.jl +++ b/base/dict.jl @@ -104,12 +104,8 @@ mutable struct Dict{K,V} <: Associative{K,V} new(zeros(UInt8,n), Array{K,1}(n), Array{V,1}(n), 0, 0, 0, 1, 0) end function Dict{K,V}(d::Dict{K,V}) where V where K - if d.ndel > 0 - rehash!(d) - end - @assert d.ndel == 0 - new(copy(d.slots), copy(d.keys), copy(d.vals), 0, d.count, d.age, d.idxfloor, - d.maxprobe) + new(copy(d.slots), copy(d.keys), copy(d.vals), d.ndel, d.count, d.age, + d.idxfloor, d.maxprobe) end end function Dict{K,V}(kv) where V where K @@ -346,7 +342,7 @@ end # get the index where a key is stored, or -pos if not present # and the key would be inserted at pos # This version is for use by setindex! and get! -function ht_keyindex2(h::Dict{K,V}, key) where V where K +function ht_keyindex2!(h::Dict{K,V}, key) where V where K age0 = h.age sz = length(h.keys) iter = 0 @@ -393,7 +389,7 @@ function ht_keyindex2(h::Dict{K,V}, key) where V where K rehash!(h, h.count > 64000 ? sz*2 : sz*4) - return ht_keyindex2(h, key) + return ht_keyindex2!(h, key) end @propagate_inbounds function _setindex!(h::Dict, v, key, index) @@ -424,7 +420,7 @@ end function setindex!(h::Dict{K,V}, v0, key::K) where V where K v = convert(V, v0) - index = ht_keyindex2(h, key) + index = ht_keyindex2!(h, key) if index > 0 h.age += 1 @@ -490,14 +486,14 @@ function get!(default::Callable, h::Dict{K,V}, key0) where V where K end function get!(default::Callable, h::Dict{K,V}, key::K) where V where K - index = ht_keyindex2(h, key) + index = ht_keyindex2!(h, key) index > 0 && return h.vals[index] age0 = h.age v = convert(V, default()) if h.age != age0 - index = ht_keyindex2(h, key) + index = ht_keyindex2!(h, key) end if index > 0 h.age += 1 diff --git a/base/precompile.jl b/base/precompile.jl index 37ded112a894a..b047275fbd82f 100644 --- a/base/precompile.jl +++ b/base/precompile.jl @@ -304,7 +304,7 @@ precompile(Tuple{typeof(Base.extrema), Array{Int64, 1}}) precompile(Tuple{typeof(Base.Sort.sort_int_range!), Array{Int64, 1}, Int64, Int64}) precompile(Tuple{typeof(Core.Inference.isbits), Base.Sort.QuickSortAlg}) precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##addprocs_locked")), Array{Any, 1}, typeof(Base.Distributed.addprocs_locked), Base.Distributed.LocalManager}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Symbol}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Symbol}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Symbol, Symbol, Int64}) precompile(Tuple{Type{Base.Dict{Any, Any}}, Base.Pair{Symbol, Symbol}, Base.Pair{Symbol, String}, Base.Pair{Symbol, String}, Base.Pair{Symbol, Base.Cmd}, Base.Pair{Symbol, Bool}}) precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##addprocs")), Array{Any, 1}, typeof(Base.Distributed.addprocs), Base.Distributed.LocalManager}) @@ -319,7 +319,7 @@ precompile(Tuple{typeof(Base.write), Base.Terminals.TerminalBuffer, Array{UInt8, precompile(Tuple{typeof(Base.LineEdit.keymap), Array{Base.Dict{Any, Any}, 1}}) precompile(Tuple{typeof(Base.LineEdit.add_specialisations), Base.Dict{Char, Any}, Base.Dict{Char, Any}, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Base.Dict{Char, Any}, Char}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Char, Any}, Char}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Char, Any}, Char}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Base.Dict{Char, Any}, Char, Int64}) precompile(Tuple{typeof(Base.setdiff), Base.KeyIterator{Base.Dict{Any, Any}}, Base.KeyIterator{Base.Dict{Any, Any}}}) precompile(Tuple{typeof(Base.LineEdit.keymap_merge), Base.Dict{Char, Any}, Base.Dict{Any, Any}}) @@ -417,7 +417,7 @@ precompile(Tuple{typeof(Base.push!), Array{String, 1}, Base.SubString{String}}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Char, Char}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Char, Char, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Int64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.KeyAlias, Int64, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, String, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, String, String, Int64}) @@ -434,7 +434,7 @@ precompile(Tuple{getfield(Base.LineEdit, Symbol("#kw##add_nested_key!")), Array{ precompile(Tuple{typeof(Base._setindex!), Base.Dict{Char, Any}, Base.LineEdit.KeyAlias, Char, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Char, Any}, Base.LineEdit.KeyAlias, Char}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Void}, Void, String}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Void}, String}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Void}, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Void}, Void, String, Int64}) precompile(Tuple{typeof(Base.LineEdit.fixup_keymaps!), Base.Dict{Char, Any}, Int64, Char, Void}) precompile(Tuple{typeof(Base.LineEdit.run_interface), Base.Terminals.TTYTerminal, Base.LineEdit.ModalInterface}) @@ -449,15 +449,15 @@ precompile(Tuple{typeof(Base.done), Array{Base.LineEdit.TextInterface, 1}, Int64 precompile(Tuple{typeof(Base.next), Array{Base.LineEdit.TextInterface, 1}, Int64}) precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, Base.LineEdit.Prompt}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.PromptState, Base.LineEdit.Prompt}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.LineEdit.Prompt}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.Prompt}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.PromptState, Base.LineEdit.Prompt, Int64}) precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.SearchState, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.SearchState, Base.LineEdit.HistoryPrompt{Base.REPL.REPLHistoryProvider}, Int64}) precompile(Tuple{typeof(Base.LineEdit.init_state), Base.Terminals.TTYTerminal, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.LineEdit.PrefixSearchState, Base.LineEdit.PrefixHistoryPrompt{Base.REPL.REPLHistoryProvider}, Int64}) precompile(Tuple{typeof(Core.Inference.isbits), Tuple{Tuple{}, Void}}) precompile(Tuple{typeof(Base.take!), Base.Channel{Any}}) @@ -645,7 +645,7 @@ precompile(Tuple{typeof(Base.is_default_method), Method}) precompile(Tuple{getfield(Base, Symbol("#kw##show")), Array{Any, 1}, typeof(Base.show), Base.GenericIOBuffer{Array{UInt8, 1}}, Method}) precompile(Tuple{typeof(Base.sort!), Array{String, 1}}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{String, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{String, Void}, String}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{String, Void}, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{String, Void}, Void, String, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{String, Void}, Void, String}) precompile(Tuple{typeof(Base.Filesystem.realpath), Base.SubString{String}}) @@ -755,7 +755,7 @@ precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{String, String}, String}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, Tuple{String, String}}, Symbol}) precompile(Tuple{typeof(Base.print), Base.TTY, Char, Char}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{String, String}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{String, String}, String}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{String, String}, String}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{String, String}, String, String, Int64}) precompile(Tuple{typeof(Core.Inference.isbits), Base.Dict{String, String}}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{String, String}, String, String}) @@ -797,7 +797,7 @@ precompile(Tuple{Type{Base.Set{Symbol}}, Tuple{Symbol}}) precompile(Tuple{typeof(Base.union!), Base.Set{Symbol}, Tuple{Symbol}}) precompile(Tuple{typeof(Base.unique_from), Array{Any, 1}, Array{Symbol, 1}, Base.Set{Symbol}, Int64}) precompile(Tuple{typeof(Base.convert), Type{Base.Set{Any}}, Base.Set{Symbol}}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Void}, Symbol}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Void}, Symbol}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Void}, Void, Symbol, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Void}, Void, Symbol}) precompile(Tuple{typeof(Base.union!), Base.Set{Any}, Base.Set{Symbol}}) @@ -922,9 +922,9 @@ precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Array{Base.Docs.D precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Docs.Binding, Symbol, Int64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Type{Union{}}, Symbol, Int64}) precompile(Tuple{typeof(Base._collect), Array{Base.Docs.DocStr, 1}, Base.Generator{Array{Base.Docs.DocStr, 1}, typeof(Base.Docs.parsedoc)}, Base.EltypeUnknown, Base.HasShape}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Union{DataType, typeof(Type)}, Void}, typeof(Type)}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Void}, typeof(Type)}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, typeof(Type), Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Union{DataType, typeof(Type)}, Void}, DataType}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Union{DataType, typeof(Type)}, Void}, DataType}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, DataType, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, DataType}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Union{DataType, typeof(Type)}, Void}, Void, typeof(Type)}) @@ -1205,7 +1205,7 @@ precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, ty precompile(Tuple{typeof(Base.Distributed.send_msg_), Base.Distributed.Worker, Base.Distributed.MsgHeader, Base.Distributed.JoinPGRPMsg, Bool}) precompile(Tuple{typeof(Base.Distributed.send_msg_now), Base.Distributed.Worker, Base.Distributed.MsgHeader, Base.Distributed.JoinPGRPMsg}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Int64, Void}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Void}, Int64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Void}, Void, Int64, Int64}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{AbstractString, Base.Semaphore}, Int64}) precompile(Tuple{typeof(Base.resize!), Array{Base.Semaphore, 1}, Int64}) @@ -1322,14 +1322,14 @@ precompile(Tuple{typeof(Base.ndigits0z), UInt8}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Any, Any}, Base.Distributed.RemoteValue, Base.Distributed.RRID}) precompile(Tuple{typeof(Base.dec), UInt8, Int64, Bool}) precompile(Tuple{typeof(Core.Inference.mk_getfield), TypedSlot, Int64, Type{Integer}}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Any, Any}, Base.Distributed.RRID}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Any, Any}, Base.Distributed.RRID}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Any, Any}, Base.Distributed.RemoteValue, Base.Distributed.RRID, Int64}) precompile(Tuple{typeof(Core.Inference.length), Tuple{Core.Inference.Const, DataType, Core.Inference.Const}}) precompile(Tuple{typeof(Core.Inference.getindex), Tuple{Core.Inference.Const, DataType, Core.Inference.Const}, Int64}) precompile(Tuple{typeof(Base.notify), Base.Condition, Base.Distributed.ProcessExitedException, Bool, Bool}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{Int64, Void}, Int64}) precompile(Tuple{typeof(Base.Distributed.process_messages), Base.TCPSocket, Base.TCPSocket, Bool}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Int64, Void}, Int64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Int64, Void}, Int64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{Int64, Void}, Void, Int64, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{Int64, Void}, Void, Int64}) precompile(Tuple{typeof(Base.pop!), Base.Dict{Int64, Union{Base.Distributed.Worker, Base.Distributed.LocalProcess}}, Int64, Void}) @@ -1370,7 +1370,7 @@ precompile(Tuple{typeof(Base.Serializer.serialize_cycle), Base.Distributed.Clust precompile(Tuple{typeof(Base.Serializer.serialize_type), Base.Distributed.ClusterSerializer{Base.TCPSocket}, DataType}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, UInt64}, Int64}) precompile(Tuple{typeof(Base.resize!), Array{UInt64, 1}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{UInt64, UInt64}, UInt64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, UInt64}, UInt64}) precompile(Tuple{typeof(Base.Serializer.serialize), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Bool}) precompile(Tuple{typeof(Base.Distributed.serialize_global_from_main), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Symbol}) precompile(Tuple{typeof(Base.Serializer.serialize_mod_names), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Module}) @@ -1379,7 +1379,7 @@ precompile(Tuple{typeof(Core.Inference.isbits), Symbol}) precompile(Tuple{typeof(Base.Serializer.serialize), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Module}) precompile(Tuple{typeof(Base.isassigned), Array{Symbol, 1}, Int64}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{UInt64, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{UInt64, Void}, UInt64}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{UInt64, Void}, UInt64}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{UInt64, Void}, Void, UInt64, Int64}) precompile(Tuple{typeof(Base.Serializer.serialize), Base.Distributed.ClusterSerializer{Base.TCPSocket}, Array{Any, 1}}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{WeakRef, Any}, TypeName}) @@ -1549,7 +1549,7 @@ precompile(Tuple{typeof(Base.Distributed.remotecall_fetch), typeof(Base.Distribu precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##remotecall_fetch")), Array{Any, 1}, typeof(Base.Distributed.remotecall_fetch), typeof(Base.Distributed.put_ref), Base.Distributed.Worker, Base.Distributed.RRID, Base.Distributed.WorkerPool}) precompile(Tuple{getfield(Base.Distributed, Symbol("#kw##remotecall_fetch")), Array{Any, 1}, typeof(Base.Distributed.remotecall_fetch), typeof(Base.Distributed.put_ref), Base.Distributed.LocalProcess, Base.Distributed.RRID, Base.Distributed.WorkerPool}) precompile(Tuple{typeof(Base.rehash!), Base.Dict{WeakRef, Void}, Int64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{WeakRef, Void}, WeakRef}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{WeakRef, Void}, WeakRef}) precompile(Tuple{typeof(Base._setindex!), Base.Dict{WeakRef, Void}, Void, WeakRef, Int64}) precompile(Tuple{typeof(Base.setindex!), Base.Dict{WeakRef, Void}, Void, WeakRef}) precompile(Tuple{typeof(Base.finalizer), typeof(Base.Distributed.finalize_ref), Base.Distributed.RemoteChannel{Base.Channel{Any}}}) @@ -1723,9 +1723,9 @@ precompile(Tuple{typeof(Base.getindex), Type{Tuple{String, Float64}}, Tuple{Stri precompile(Tuple{typeof(Base.Grisu._show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Float64, Int64, Int64, Bool, Bool}) precompile(Tuple{typeof(Base.hash), Base.Distributed.Future, UInt64}) precompile(Tuple{typeof(Base.hash), Tuple{String, Float64}, UInt64}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Symbol, Base.Condition}, Symbol}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Symbol, UInt64}, Symbol}) -precompile(Tuple{typeof(Base.ht_keyindex2), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Symbol, Base.Condition}, Symbol}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Symbol, UInt64}, Symbol}) +precompile(Tuple{typeof(Base.ht_keyindex2!), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, Base.Condition}, Symbol}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Symbol, UInt64}, Symbol}) precompile(Tuple{typeof(Base.ht_keyindex), Base.Dict{Tuple{String, Float64}, Void}, Tuple{String, Float64}}) diff --git a/test/dict.jl b/test/dict.jl index 77df74d3e0625..aa0d21c32e1c8 100644 --- a/test/dict.jl +++ b/test/dict.jl @@ -91,6 +91,14 @@ end end end +let x = Dict(3=>3, 5=>5, 8=>8, 6=>6) + pop!(x, 5) + for k in keys(x) + Dict{Int,Int}(x) + @test k in [3, 8, 6] + end +end + let z = Dict() get_KeyError = false try