I want to do something like this:
merge({'a': 1}, {'b': 2})
and get a return of {'a': 1, 'b':2}
.
- I don't want to use
.update()
, which sadly doesn't return the updated or a newdict
, justNone
(why?.....). - Since I know
.update()
, I could write a 3 line function for this. I don't, I just want an already existing/known package that do this kind of job in a simple way.
EDIT
This edit is just to explain the lovely SO users that this is not a duplicate of How to merge two Python dictionaries in a single expression? and hence the chosen answer is unrelated with any of the answers provided in the candidate duplicate.