
March 4, 2019
2:42 p.m.
On Mon, Mar 4, 2019, 8:30 AM Serhiy Storchaka <storchaka@gmail.com> wrote:
But is merging two dicts a common enough problem that needs introducing an operator to solve it? I need to merge dicts maybe not more than one or two times by year, and I am fine with using the update() method. Perhaps {**d1, **d2} can be more appropriate in some cases, but I did not encounter such cases yet.
Like other folks in the thread, I also want to merge dicts three times per year. And every one of those times, itertools.ChainMap is the right way to do that non-destructively, and without copying.