[Python-checkins] python/dist/src/Doc/ref ref3.tex,1.110,1.111
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Wed, 16 Jul 2003 12:40:25 -0700
Update of /cvsroot/python/python/dist/src/Doc/ref
In directory sc8-pr-cvs1:/tmp/cvs-serv2906
Modified Files:
ref3.tex
Log Message:
Clarify the lack of relationship between rich comparison operators.
Prompted by a discussion on comp.lang.python.
Index: ref3.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** ref3.tex 15 Jul 2003 22:03:00 -0000 1.110
--- ref3.tex 16 Jul 2003 19:40:23 -0000 1.111
***************
*** 1090,1093 ****
--- 1090,1098 ----
By convention, \code{False} is used for false and \code{True} for true.
+ There are no implied relationships among the comparison operators.
+ The truth of {\var{x}==\var{y}} does not imply that \code{\var{x}!=\var{y}}
+ is false. Accordingly, when defining \method{__eq__}, one should also
+ define \method{__ne__} so that the operators will behave as expected.
+
There are no reflected (swapped-argument) versions of these methods
(to be used when the left argument does not support the operation but