We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Compare:
julia> mutable struct ConstIdentity end julia> dict = OrderedDict{ConstIdentity, Int64}() Dict{ConstIdentity, Int64}() julia> dict[ConstIdentity()] = 1 1 julia> dict[ConstIdentity()] = 2 2 julia> all(haskey.((dict,), keys(dict))) true julia> dict2 = deepcopy(dict) OrderedDict{ConstIdentity, Int64} with 2 entries: ConstIdentity() => 1 ConstIdentity() => 2 julia> all(haskey.((dict2,), keys(dict2))) false
vs Dict:
Dict
julia> mutable struct ConstIdentity end julia> dict = Dict{ConstIdentity, Int64}() Dict{ConstIdentity, Int64}() julia> dict[ConstIdentity()] = 1 1 julia> dict[ConstIdentity()] = 2 2 julia> all(haskey.((dict,), keys(dict))) true julia> dict2 = deepcopy(dict) Dict{ConstIdentity, Int64} with 2 entries: ConstIdentity() => 1 ConstIdentity() => 2 julia> all(haskey.((dict2,), keys(dict2))) true
We need to override deepcopy_internal to rehash like base does: https://github.com/JuliaLang/julia/blob/13155226e11fa025be5d4d3033d25c1091b35887/base/deepcopy.jl#L141-L156
deepcopy_internal
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Compare:
vs
Dict
:We need to override
deepcopy_internal
to rehash like base does:https://github.com/JuliaLang/julia/blob/13155226e11fa025be5d4d3033d25c1091b35887/base/deepcopy.jl#L141-L156
The text was updated successfully, but these errors were encountered: