How to make a copy of chained dicts effectively and nicely?

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Tue Sep 27 03:16:14 EDT 2016


On Tuesday, September 27, 2016 at 8:08:46 PM UTC+13, Nagy László Zsolt wrote:
> d1 = {'a':1, 'b':2}
> d2 = {'c':3, 'd':4}
> d3 = {'e':5, 'f':6}
> 
> Is there a version that is as effective as #3, but as clean and nice as #4?

dict(dict(d1, **d2), **d3)



More information about the Python-list mailing list