Or
dictAB = dict(dictA, **dictB)
in Python 2 and 3. dictAB = dict(dictA, **dictB)
in Python 2 and 3.It also has different semantics from a.update(b). The unpacking way will explode when both a and b contain the same key, while a.update(b) does not; existing keys also contained in b will be overwritten by the values from b.