[issue4395] Document auto __ne__ generation; provide a use case for non-trivial __ne__

Terry J. Reedy report at bugs.python.org
Sat Jun 20 01:06:14 CEST 2009


Terry J. Reedy <tjreedy at udel.edu> added the comment:

The current paragraph
"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 __eq__(), one should also define __ne__() so that the operators
will behave as expected. "
is false.

Please, let us replace it now, for 3.1 release, with the correct
"There is one implied relationship among comparison operators: defining
__eq__ gives an automatic __ne__ (but not the other way).  There is no
similar relationship for the order comparisons."
without waiting for a more extensive rewrite.

----------
versions: +Python 3.1 -Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4395>
_______________________________________


More information about the Python-bugs-list mailing list