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/135354.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.xEthan Furman ethan at stoneleaf.us
Tue Jul 8 02:22:16 CEST 2014
On 07/07/2014 05:12 PM, Andreas Maier wrote:
> Am 2014-07-07 18:09, schrieb Ethan Furman:
>>
>> Just because two instances from the same object have the same value does not mean they are equal.  For a real-life
>> example, look at twins:  biologically identical, yet not equal.
>
> I think they *are* equal in Python if they have the same value, by definition, because somewhere the Python docs state
> that equality compares the object's values.

And is personality of no value, then?


> The reality though is that value is more vague than equality test (as it was already pointed out in this thread): A
> class designer can directly implement what equality means to the class, but he or she cannot implement an accessor
> method for the value. The value plays a role only indirectly as part of equality and ordering tests.

Not sure what you mean by this.

--
~Ethan~
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