Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 40c509d

Browse files
committed
cmp() is not really gone.
1 parent d2aa7e6 commit 40c509d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

Doc/whatsnew/3.0.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,11 @@ Python 3.0 has simplified the rules for ordering comparisons:
189189
argument instead. N.B. the *key* and *reverse* arguments are now
190190
"keyword-only".
191191

192-
* The :func:`cmp` function is gone, and the :meth:`__cmp__` special
193-
method is no longer supported. Use :meth:`__lt__` for sorting,
194-
:meth:`__eq__` with :meth:`__hash__`, and other rich comparisons as
195-
needed. (If you really need the :func:`cmp` functionality, you
196-
could use the expression ``(a > b) - (a < b)`` as the equivalent for
197-
``cmp(a, b)``.)
192+
* The :func:`cmp` function should be treated as gone, and the :meth:`__cmp__`
193+
special method is no longer supported. Use :meth:`__lt__` for sorting,
194+
:meth:`__eq__` with :meth:`__hash__`, and other rich comparisons as needed.
195+
(If you really need the :func:`cmp` functionality, you could use the
196+
expression ``(a > b) - (a < b)`` as the equivalent for ``cmp(a, b)``.)
198197

199198
Integers
200199
--------

0 commit comments

Comments
 (0)