Duncan Booth <[EMAIL PROTECTED]> wrote: > If 'a!=b' then it will also be the case that 'a is not b'
That's true for strings, and (as far as I know), all pre-defined types, but it's certainly possible to define a class which violates that. class isButNotEqual: def __ne__ (self, other): return True a = isButNotEqual() b = a print "a != b:", a != b print "a is not b:", a is not b frame:play$ ./eq.py a != b: True a is not b: False On the other hand, I can't imagine any reason why you would want to define such a class, other than as a demonstration (or part of an obfuscated Python contest). -- http://mail.python.org/mailman/listinfo/python-list