classMyDict(dict):def__add__(self,other):returnMyDict(self,**other)if__name__=='__main__':d1=MyDict(foo=1)d2=MyDict(bar=2,baz=3)d3=MyDict(qux=4)d4=d1+d2+d3importpprintpprint.pprint(d4)# What if keys collide? Last one wins.d5=d4+{'foo':99}+{'foo':999}pprint.pprint(d5)