3 ms·
> it’s not super obvious what to do when the keys are equal d1 | d2 | d3 | ... is equivalent to: {**d1, **d2, **d3, ...}
by kbd 8y ago
> it’s not super obvious what to do when the keys are equal
d1 | d2 | d3 | ...
is equivalent to:
{**d1, **d2, **d3, ...}
- dan-robertson 8y agoNow read the above but instead of “it’s not super obvious what d1 | d2 should be because losing information/desirable properties/weird errors”, read “it’s not super obvious what {**d1, **d2} should be because losing information/desirable properties/weird errors”. Except I guess one could throw in something about TOOWTDI too.
- kbd 8y agoI actually think it is obvious what a dictionary merge should do (overwrite keys on the left with keys on the right), but this is besides the point because it's already been determined for {**d1, **d2} In other words, there are no new semantics to discuss here. I'm just saying the two syntaxes should be equivalent.