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/135496.html below:

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

[Python-Dev] == on object tests identity in 3.x - list delegation to members?Andreas Maier andreas.r.maier at gmx.de
Mon Jul 14 07:33:46 CEST 2014
Am 14.07.2014 04:55, schrieb Ethan Furman:
> On 07/13/2014 08:13 AM, Andreas Maier wrote:
>> Test #8: Same object of class C
>>     (C.__eq__() implemented with equality of x,
>>      C.__ne__() returning NotImplemented):
>>
>>    obj1: type=<class '__main__.C'>, str=C(256), id=39406504
>>    obj2: type=<class '__main__.C'>, str=C(256), id=39406504
>>
>>    a) obj1 is obj2: True
>> C.__eq__(): self=39406504, other=39406504, returning True
>
> This is interesting/weird/odd -- why is __eq__ being called for an 'is'
> test?

The debug messages are printed before the result is printed. So this is 
the debug message for the next case, 8.b).

Sorry for not explaining it.

Andy

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