Frank Niessink <[EMAIL PROTECTED]> added the comment: Just to reiterate the original bug report: the issue (for me) is that currently (python 2.5): >>> [].__add__ == [].__add__ True >>> [].__add__ == [1].__add__ False
Or, using a non-builtin class: >>> class C(object): ... def __eq__(self, other): ... return False ... def foo(self): ... pass ... >>> C().foo == C().foo False >>> class C(object): ... def __eq__(self, other): ... return True ... def foo(self): ... pass ... >>> C().foo == C().foo True I think it makes little sense that the equality test for the instance methods takes the equality of the instances into account. Imho, this behaviour is inconsistent with the principle of no surprises. The correct behaviour (again imho of course) is that instance methods only compare equal to the same instance method of the same instance, where 'same instance' is based on 'is' not on '=='. Cheers, Frank _____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1617161> _____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com