title: Python Bitwise Inverse Not Flipping Bits
body: <p>When using pythons inverse ~, it seems the bits are not flipped as I would expect them to be. I believe the confusion lies in my understanding of how python stores numbers using 2's compliment.</p>
  
  <pre><code>myInt = 5 #101
  inverse = ~myInt
  print(bin(inverse))
  </code></pre>
  
  <p>Output: -0b110</p>
  
  <p>Expected: -0b010, or -0b10</p>