title: Efficient way to build a MySQL update query in Python
body: <p>I have a class variable called attributes which lists the instance variables I want to update in a database:</p>
  
  <pre><code>attributes = ['id', 'first_name', 'last_name', 'name', 'name_url',
                'email', 'password', 'password_salt', 'picture_id']
  </code></pre>
  
  <p>Each of the class attributes are updated upon instantiation.</p>
  
  <p>I would like to loop through each of the attributes and build a MySQL update query in the form of:</p>
  
  <pre><code>UPDATE members SET id = self._id, first_name = self._first name ...
  </code></pre>
  
  <p>Thanks.</p>