# HG changeset patch # Parent 951552f602b261a088145c596695f5889b907926 Document object.__ne__() behaviour and priority of reflected comparisons Issues 4395 (__ne__), 22052 (reflection) More tests in patch for 21408 (__ne__ bug) diff -r 951552f602b2 Doc/reference/datamodel.rst --- a/Doc/reference/datamodel.rst Mon Jul 20 00:25:50 2015 -0400 +++ b/Doc/reference/datamodel.rst Mon Jul 20 07:08:35 2015 +0000 @@ -1276,10 +1276,14 @@ context (e.g., in the condition of an ``if`` statement), Python will call :func:`bool` on the value to determine if the result is true or false. - There are no implied relationships among the comparison operators. The truth - of ``x==y`` does not imply that ``x!=y`` is false. Accordingly, when - defining :meth:`__eq__`, one should also define :meth:`__ne__` so that the - operators will behave as expected. See the paragraph on :meth:`__hash__` for + By default, :meth:`__ne__` delegates to :meth:`__eq__` and + inverts the result unless it is ``NotImplemented``. There are no other + implied relationships among the comparison operators, for example, + the truth of ``(x