Commit 40c509d0 authored by Georg Brandl's avatar Georg Brandl

cmp() is not really gone.

parent d2aa7e66
......@@ -189,12 +189,11 @@ Python 3.0 has simplified the rules for ordering comparisons:
argument instead. N.B. the *key* and *reverse* arguments are now
"keyword-only".
* The :func:`cmp` function is gone, and the :meth:`__cmp__` special
method is no longer supported. Use :meth:`__lt__` for sorting,
:meth:`__eq__` with :meth:`__hash__`, and other rich comparisons as
needed. (If you really need the :func:`cmp` functionality, you
could use the expression ``(a > b) - (a < b)`` as the equivalent for
``cmp(a, b)``.)
* The :func:`cmp` function should be treated as gone, and the :meth:`__cmp__`
special method is no longer supported. Use :meth:`__lt__` for sorting,
:meth:`__eq__` with :meth:`__hash__`, and other rich comparisons as needed.
(If you really need the :func:`cmp` functionality, you could use the
expression ``(a > b) - (a < b)`` as the equivalent for ``cmp(a, b)``.)
Integers
--------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment