Very often I need to create dicts that differ one from another by an item or two. Here is what I usually do:
setup1 = {\'param1\': val1, 
            \'param         
        
This is an extension to the nice answer posted by Adam Matan:
def copy_dict(d, diffs={}, **kwargs):
    res = dict(d)
    res.update(diffs)
    res.update(kwargs)
    return res
The only difference is the addition of kwargs. Now one can write
setup2 = copy_dict(setup1, {'param1': val10, 'param2': val20})
or
setup2 = copy_dict(setup1, param1=val10, param2=val20)