title: Python: In-place "not'ing" of booleans
body: <p>I sometimes have a dictionary of booleans like the following;</p>
  
  <pre><code>d = {'a': True, 'b': False, 'c': False}
  </code></pre>
  
  <p>which I use as a collection of switches which all have to be on (<code>True</code>) in order for some operation to happen. While iterating, these switches are then flipped, e.g.</p>
  
  <pre><code>for char in text:
      if char == '0':
          d['a'] = not d['a']  # State of 'a' is switched
      ...
  </code></pre>
  
  <p>The fact that <code>'a'</code> has to be looked up twice in the above bothers me. Were I to represent the values of the switches by <code>1</code> and <code>-1</code> I could do the switching like <code>d['a'] *= -1</code>, which only reference the <code>d['a']</code> once. </p>
  
  <p>Ideally Python would supply me with an in-place "not assignment" operator.</p>