title: Why is the cmp parameter removed from sort/sorted in Python3.0?
body: <p>from <a href="https://wiki.python.org/moin/HowTo/Sorting/#The_Old_Way_Using_the_cmp_Parameter">python wiki</a>: 
  <code>In Py3.0, the cmp parameter was removed entirely (as part of a larger effort to simplify and unify the language, eliminating the conflict between rich comparisons and the __cmp__ methods).</code></p>
  
  <p>I do not understand the reasoning why cmp is removed in py3.0</p>
  
  <p>consider this example:</p>
  
  <pre><code>&gt;&gt;&gt; def numeric_compare(x, y):
          return x - y
  &gt;&gt;&gt; sorted([5, 2, 4, 1, 3], cmp=numeric_compare)
  [1, 2, 3, 4, 5]
  </code></pre>
  
  <p>and now consider this version (recommended and compatible with 3.0):</p>
  
  <pre><code>def cmp_to_key(mycmp):
      'Convert a cmp= function into a key= function'
      class K(object):
          def __init__(self, obj, *args):
              self.obj = obj
          def __lt__(self, other):
              return mycmp(self.obj, other.obj) &lt; 0
          def __gt__(self, other):
              return mycmp(self.obj, other.obj) &gt; 0
          def __eq__(self, other):
              return mycmp(self.obj, other.obj) == 0
          def __le__(self, other):
              return mycmp(self.obj, other.obj) &lt;= 0
          def __ge__(self, other):
              return mycmp(self.obj, other.obj) &gt;= 0
          def __ne__(self, other):
              return mycmp(self.obj, other.obj) != 0
      return K
  
  &gt;&gt;&gt; sorted([5, 2, 4, 1, 3], key=cmp_to_key(reverse_numeric))
  [5, 4, 3, 2, 1]
  </code></pre>
  
  <p>The latter is very verbose and the same purpose is achieved in the former with just one line. On another note, I am writing my custom class for which I want to write the <code>__cmp__</code> method. from my little reading across web, it is recommended to write <code>__lt__,__gt__,__eq__,__le__,__ge__,__ne__ and not __cmp__</code>
  Again, why this recommendation? can I not just define <code>__cmp__</code> making life simpler?</p>