]> granicus.if.org Git - python/commitdiff
list.sort() and builtin.sorted() no longer accept 'cmp' argument.
authorKurt B. Kaiser <kbk@shore.net>
Wed, 13 Feb 2008 16:09:27 +0000 (16:09 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Wed, 13 Feb 2008 16:09:27 +0000 (16:09 +0000)
Doc/whatsnew/3.0.rst

index c9416db3983bff2f745af2b8b13407301fe9707e..ace0199bca9cf3261b9c55549186be6494bccdf6 100644 (file)
@@ -141,6 +141,10 @@ changes to rarely used features.)
   :meth:`dict.values` return views instead of lists.  For example, this no
   longer works: ``k = d.keys(); k.sort()``.  Use ``k = sorted(d)`` instead.
 
+* :meth:`builtin.sorted` and :meth:`list.sort` no longer accept the `cmp`
+  argument providing a comparision function.  Use the `key` argument
+  instead. N.B. the `key` and `reverse` arguments are now "keyword-only".
+
 * ``1/2`` returns a float.  Use ``1//2`` to get the truncating behavior.
 
 * The :func:`repr` of a long integer doesn't include the trailing ``L``