title: Declaring existing data types in the Python library
body: <p>I find the following line often in the <a href="https://docs.python.org/2/library/random.html" rel="nofollow"><code>random</code></a> module of Python 2.7:</p>
  
  <pre><code>_int = int
  </code></pre>
  
  <p>After that line, the code uses the new type <code>_int</code> instead of <code>int</code>. For example:</p>
  
  <pre><code>def shuffle(self, x, random=None):
      if random is None:
          random = self.random
      _int = int
      for i in reversed(xrange(1, len(x))):
          # pick an element in x[:i+1] with which to exchange x[i]
          j = _int(random() * (i+1))
          x[i], x[j] = x[j], x[i]
  </code></pre>
  
  <p>In the <a href="https://docs.python.org/2/library/string.html" rel="nofollow"><code>string</code></a> module, I found this:</p>
  
  <pre><code>####################################################################
  # NOTE: Everything below here is deprecated.  Use string methods instead.
  # This stuff will go away in Python 3.0.
  
  [..]
  
  # for a bit of speed
  _float = float
  _int = int
  _long = long
  </code></pre>
  
  <p>Why does the library use <code>_int</code> instead of <code>int</code>? Why is that faster than just using the built-in <code>int</code>?</p>