Closed SagiPolaczek closed 2 years ago
@mosheraboh Found this issue. What do you think is the right behavior? Merging values into sequences or print warning?
In my opinion we should merge + print a warning (and add a flag to turn it off). I encountered this issue while examine to merge two batch_dict
s..
I think that we should follow the standard python dicts - so override should be ok. Here is a link for reference: https://www.geeksforgeeks.org/merging-and-updating-dictionary-operators-in-python-3-9/ @SagiPolaczek , let me know if it makes sense to you.
I think that we should follow the standard python dicts - so override should be ok. Here is a link for reference: https://www.geeksforgeeks.org/merging-and-updating-dictionary-operators-in-python-3-9/ @SagiPolaczek , let me know if it makes sense to you.
Looks OK to me :) I'm closing this issue and leaving it for future ref
Describe the bug\ When calling the
ndict.merge(other_ndict)
whenndict
andother_ndict
areNDict
objects with the same keys, the values ofother_dict
are overridingndict
's.If you are not familiar with the
NDict
object, please visit read ndict docu.FuseMedML version\ version 0.2.4
Python version\ 3.8.13
To reproduce
Expected behavior\ Merge values of the same keys into a sequence (list) OR Print a warning of the overriding