This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author christian.heimes
Recipients _doublep, christian.heimes, gvanrossum
Date 2007-11-08.13:28:13
SpamBayes Score 0.03272012
Marked as misclassified No
Message-id <1194528493.5.0.779027996968.issue1393@psf.upfronthosting.co.za>
In-reply-to
Content
Additional prints make it easy to understand what happens here:

>>> class Anything:
...     def __eq__(self, other):
...         print("eq")
...         return True
...     def __ne__(self, other):
...         print("ne")
...         return False
...
>>> x = lambda: None
>>> print(x == Anything())
False
>>> print(Anything() == x)
eq
True
>>> y = object()
>>> print(y == Anything())
eq
True
>>> print(Anything() == y)
eq
True

x == Anything() doesn't invoke Anything.__eq__(). It's using
function.__eq__().
History
Date User Action Args
2007-11-08 13:28:13christian.heimessetspambayes_score: 0.0327201 -> 0.03272012
recipients: + christian.heimes, gvanrossum, _doublep
2007-11-08 13:28:13christian.heimessetspambayes_score: 0.0327201 -> 0.0327201
messageid: <1194528493.5.0.779027996968.issue1393@psf.upfronthosting.co.za>
2007-11-08 13:28:13christian.heimeslinkissue1393 messages
2007-11-08 13:28:13christian.heimescreate