by io41 · 15y ago · 0 comments
https://gist.github.com/24651d78d3f1e3dec6f4 :
def new_dict(args, *kwargs):
"""
Create new dicts
>>> new_dict({1:2}, {2:5}, foo=5)
{1: 2, 2: 5, 'foo': 5}
"""
d = {}
for arg in args:
d.update(arg)
d.update(kwargs)
return d
d = new_dict(old_dict1, old_dict2, old_dictN, foo='bar')No comments yet.