Author xtreak
Recipients ElizabethU, serhiy.storchaka, xtreak
Date 2019-07-12.05:23:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1562909037.66.0.649610656302.issue37555@roundup.psfhosted.org>
In-reply-to
Content
> Karthikeyan, I think there is a flaw in your example. The good __eq__ should return NotImplemented instead of False for other types. This wil allow the right operand's __eq__ to play.

Serhiy, my example was to try reproducing the original report where Django model tries to check if the other's type and returns False if the type is not a Django model. There could be cases where __eq__ implementation of a class could be just returning False instead of raising a NotImplemented error due to difference in type that affects comparison of ANY.

> Django first checks if the thing it's comparing to is another Django model, and returns False if not. So, <DjangoModel> == ANY is False, but ANY == <DjangoModel> is True.
History
Date User Action Args
2019-07-12 05:23:57xtreaksetrecipients: + xtreak, serhiy.storchaka, ElizabethU
2019-07-12 05:23:57xtreaksetmessageid: <1562909037.66.0.649610656302.issue37555@roundup.psfhosted.org>
2019-07-12 05:23:57xtreaklinkissue37555 messages
2019-07-12 05:23:57xtreakcreate