A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-July/135338.html below:

[Python-Dev] == on object tests identity in 3.x

[Python-Dev] == on object tests identity in 3.x [Python-Dev] == on object tests identity in 3.xTerry Reedy tjreedy at udel.edu
Mon Jul 7 20:20:42 CEST 2014
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

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4