Assigning values from dictionary to object
<p>I very often need to do something like this:</p>

<pre><code>"Some dictionary with values obtained somehow (e.g. submitted form values)"
my_dict = {
    'name': 'John',
    'surname': 'Doe',
    'age': 27,
    'hair_color': 'green',
}

"object person is some instance of class representing person"
person.name = my_dict['name']
person.surname = my_dict['surname']
person.age = my_dict['age']
person.hair_color = my_dict['hair_color']
</code></pre>

<p>I think this is a lot of repetition. What approach do you use?</p>
