title: How does Python manage int and long?
body: <p>Does anybody know how Python manage internally int and long types? </p>
  
  <ul>
  <li>Does it choose the right type dynamically? </li>
  <li>What is the limit for an int?</li>
  <li>I am using Python 2.6, Is is different with previous versions?</li>
  </ul>
  
  <p>How should I understand the code below?</p>
  
  <pre><code>&gt;&gt;&gt; print type(65535)
  &lt;type 'int'&gt;
  &gt;&gt;&gt; print type(65536*65536)
  &lt;type 'long'&gt;
  </code></pre>
  
  <p>Update: </p>
  
  <pre><code>&gt;&gt;&gt; print type(0x7fffffff)
  &lt;type 'int'&gt;
  &gt;&gt;&gt; print type(0x80000000)
  &lt;type 'long'&gt;
  </code></pre>