title: Python: default comparison
body: <p>In Python 2.7, I define an empty new-style class:</p>
  
  <pre><code>In [43]: class C(object): pass
     ....:
  </code></pre>
  
  <p>then create a list of instances of the new class:</p>
  
  <pre><code>In [44]: c = [C() for i in xrange(10)]
  </code></pre>
  
  <p>then attempt to sort the list:</p>
  
  <pre><code>In [45]: sorted(c)
  Out[45]:
  [&lt;__main__.C object at 0x1950a490&gt;,
   &lt;__main__.C object at 0x1950a4d0&gt;,
   ...
   &lt;__main__.C object at 0x1950aad0&gt;]
  </code></pre>
  
  <p>What's surprising is that the sort doesn't complain, even though I haven't defined a way to compare instances of <code>C</code>:</p>
  
  <pre><code>In [46]: dir(C())
  Out[46]:
  ['__class__',
   '__delattr__',
   '__dict__',
   '__doc__',
   '__format__',
   '__getattribute__',
   '__hash__',
   '__init__',
   '__module__',
   '__new__',
   '__reduce__',
   '__reduce_ex__',
   '__repr__',
   '__setattr__',
   '__sizeof__',
   '__str__',
   '__subclasshook__',
   '__weakref__']
  </code></pre>
  
  <p>What exactly is happening there, and <strong>what's the rationale for this -- arguably surprising -- behaviour?</strong></p>