[Python-ideas] Dict joining using + and +=

Rhodri James rhodri at kynesim.co.uk
Fri Mar 1 09:31:11 EST 2019


On 01/03/2019 14:06, Rémi Lapeyre wrote:
> I’m having issues to understand the semantics of d1 + d2.

That's understandable, clouds of confusion have been raised.  As far as 
I can tell it's pretty straightforward: d = d1 + d2 is equivalent to:

 >>> d = d1.copy()
 >>> d.update(d2)

All of your subsequent questions then become "What does 
DictSubclassInQuestion.update() do?" which should be well defined.


-- 
Rhodri James *-* Kynesim Ltd


More information about the Python-ideas mailing list