docs are not fully "copied" internally
dedalus2000 opened this issue · 2 comments
dedalus2000 commented
'save' and "delete_attachment" functions return an updated copy of the original document using the copy.copy function.
But should it be better to use the "copy.deepcopy" function?
Documents can have nested dictionaries; "_attachments" is one of them (and delete_attachment delete the original key), but users can add their own ones.
For my code is not a big problem as far I usually do "doc = function(doc, ..)"
niwinz commented
you are right, deepcopy is better but is very expensive :(
I go to fix it.
niwinz commented
Hmm copy seems works fine for most of cases I only need replace few copy's usage with deepcopy :D