[Python-Dev] == on object tests identity in 3.x (original) (raw)
[Python-Dev] == on object tests identity in 3.x - list delegation to members?
Ethan Furman ethan at stoneleaf.us
Mon Jul 14 07:51:04 CEST 2014
- Previous message: [Python-Dev] == on object tests identity in 3.x - list delegation to members?
- Next message: [Python-Dev] == on object tests identity in 3.x
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 07/13/2014 10:33 PM, Andreas Maier wrote:
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).
Ah, whew! That's a relief.
Sorry for not explaining it.
Had I been reading more closely I would (hopefully) have noticed that, but I was headed out the door at the time.
--
Ethan
- Previous message: [Python-Dev] == on object tests identity in 3.x - list delegation to members?
- Next message: [Python-Dev] == on object tests identity in 3.x
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]