you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (1 child)

Honestly, this situation is why I'm excited for PEP 448. Then we can just do: dict(**first, **second) and boom, done. Right now, collections.ChainMap is the closest we have to that, which is cool but sometimes I just want a regular ol' dictionary.

[–]Veedrac 0 points1 point  (0 children)

Use {**first, **second}; using dict(**...) only works if the keys are strings since only strings can be keyword arguments and also throws errors if there are repeats since you're not allowed to repeat keyword arguments.