title: How to update values in a defaultdict depending on other keys
body: <p>After a lengthy operation I get a defaultdict like the following:</p>
  <pre><code>l = defaultdict(list)
  l = [('S', ['(', 'Num']), ('Num',['Sign', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']), ('Op', ['+', '-', '*', '/']), ('Sign', ['-'])]
  print(l)
  </code></pre>
  <p>How can I now update all values for each key if they have values from another key?</p>
  <p>Expected result:</p>
  <p>Step 1:</p>
  <pre><code>l_new = [('S', ['(', 'Sign', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']), ('Num',['-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']), ('Op', ['+', '-', '*', '/']), ('Sign', ['-'])]
  print(l)
  </code></pre>
  <p>Step 2:</p>
  <pre><code>l_new = [('S', ['(', '-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']), ('Num',['-', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0']), ('Op', ['+', '-', '*', '/']), ('Sign', ['-'])]
  print(l)
  </code></pre>