title: How to get the signed integer value of a long in python?
body: <p>If lv stores a long value, and the machine is 32 bits, the following code:  </p>
  
  <pre><code>iv = int(lv &amp; 0xffffffff)
  </code></pre>
  
  <p>results an iv of type long, instead of the machine's int.  </p>
  
  <p>How can I get the (signed) int value in this case?</p>