On 7/7/2014 7:22 AM, Andreas Maier wrote:
While discussing Python issue #12067
(http://bugs.python.org/issue12067#msg222442), I learned that Python 3.4
implements '==' and '!=' on the object type such that if no special
equality test operations are implemented in derived classes, there is a
default implementation that tests for identity (as opposed to equality
of the values).

The relevant code is in function do_richcompare() in Objects/object.c.

IMHO, that default implementation contradicts the definition that '=='
and '!=' test for equality of the values of an object.

A discrepancy between code and doc can be solved by changing either the code or doc. This is a case where the code should not change (for back compatibility with long standing behavior, if nothing else) and the doc should.

--
Terry Jan Reedy

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to