title: Why does Python have a format function as well as a format method
body: <p>The <a href="http://docs.python.org/2/library/functions.html#format" rel="noreferrer"><code>format</code></a> function in builtins seems to be like a subset of the <a href="http://docs.python.org/2/library/stdtypes.html#str.format" rel="noreferrer"><code>str.format</code></a> method used specifically for the case of a formatting a single object.</p>
  
  <p>eg. </p>
  
  <pre><code>&gt;&gt;&gt; format(13, 'x')
  'd'
  </code></pre>
  
  <p>is apparently preferred over</p>
  
  <pre><code>&gt;&gt;&gt; '{0:x}'.format(13)
  'd'
  </code></pre>
  
  <p>and IMO it does look nicer, but why not just use <code>str.format</code> in every case to make things simpler? Both of these were introduced in <code>2.6</code> so there must be a good reason for having both at once, what is it?</p>
  
  <p><strong>Edit:</strong> I  was asking about <code>str.format</code> and <code>format</code>, not why we don't have a <code>(13).format</code></p>