3 ms·
Yeah, I like: z=dict(x) z.update(y) It's clear and concise, and it's obvious which one gets precedence, even if it's two lines.
by kc0bfv 14y ago
Yeah, I like:
z=dict(x)
z.update(y)
It's clear and concise, and it's obvious which one gets precedence, even if it's two lines.
- masklinn 14y agoI tend to be partial towards z = dict(x, **y) if the keys of y are compatible with unpacking.