I have a dictionary d that I'd like to copy shallowly and then change some of its contents. I noticed that if I write the changed property first, it'll get overwritten. If I write it last, it persists:
>>> d = {1: 1, 2: 2}
{1: 1, 2: 2}
>>> d1 = {1: 11, **d}
{1: 1, 2: 2}
>>> d2 = {**d, 1: 11}
{1: 11, 2: 2}
However, I know the order in a dictionary isn't reliable. Can I assume that in {**d, 1: 11}, d[1] definitely gets overwritten by the updated value?