title: Applying the same update on each item in a list that contains 1-level nested dictionary items
body: <p>I have a list that contains dictionary objects:</p>
  
  <pre><code>a = [{'name':'myname', cat:{id:1, link:'xyz'}}, {...}]
  </code></pre>
  
  <p>What I want to do is to extract the <code>id</code> inside <code>cat</code>, and assign it to <code>cat</code> itself, and repeat this for all dictionary items in the list:</p>
  
  <pre><code>a = [{'name':'myname', new_cat:1}, {...}]
  </code></pre>
  
  <p>I know I can do this using <code>for loop</code>:</p>
  
  <pre><code>new_a=[]
  for item in a:
      x = {'name':item['name'], new_cat:item['cat']['id']}
      new_a.append(x)
  </code></pre>
  
  <p>I just wanted to know if there is a more efficient way of doing this. For example, would using comprehension list work better for this?</p>