|
|
|
|
|
by andreareina
2827 days ago
|
|
I think it depends on your use case. If you're using it to unify several disparate mappings then it might make more sense for changes to affect the originating mapping. OTOH if you're using it to provide several levels of defaults (e.g. global config -> user config -> envars -> runtime config) then it makes more sense for changes to affect only the topmost mapping. This is also how union filesystems work. FWIW I find the current behavior preferable. In fact in all cases I use ChainMap the first mapping is always an empty dictionary, because I specifically don't want to mutate the others. |
|