Let say I have this code:
for obj in self.objects:
template = obj
# Exact values are only numbers (float, int) and or strings
dct = {
'a': template.id,
'b': template.some_other_value,
'c': template.some_other_value2,
}
some_other_obj.use_dct(dct) # Do something with it
for obj2 in obj:
# reuse same dictionary,
#but regenerate values from another object
template = obj2
some_other_obj.use_dct(dct)
Now doing this, old values are kept and obj2 gets same dictionary with same values as obj. Is it possible to somehow regenerate that dictionary so everything would be the same, except template would point to another object and would "regenerate" values from that another object? Or do I have to manually specify another dictionary with same keys and fill it with another object?