-
Notifications
You must be signed in to change notification settings - Fork 39
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
saving with bson modifies dict argument #26
Comments
Hi, this seems to be a big problem for me as I later want to use the dictionaries I save using |
Note that this also happens to dicts nested within other data:
And also note that this is also present in v0.14, the last Julia 0.6 version. |
A workaround: julia> d = Dict{Any,Any}(:a => [1+2im, 3+4im], :b => "Hello, World!")
Dict{Any,Any} with 2 entries:
:a => Complex{Int64}[1+2im, 3+4im]
:b => "Hello, World!"
julia> bson("/tmp/test.bson", d)
julia> d
Dict{Any,Any} with 2 entries:
:a => Complex{Int64}[1+2im, 3+4im]
:b => "Hello, World!" |
So the workaround is to define the dictionary as |
Yes |
In #29 is a start to fix this. But I cannot spend more time on it. Maybe one of you can? |
The workaround does not work for me :(
Btw, I think tt should be somewhere more clearly stated that the serialization function modifies the argument, it caused me some nasty bugs, looking forward to the merge. |
Writing with
bson(file, dict)
seems to modify thedict
argument.Is this the intended behaviour?
The text was updated successfully, but these errors were encountered: