Entry
What does == test for? In Java, there's both == and equals(). What are the Python equivalents?
Jun 29th, 2000 13:32
Jason Trowbridge, Robb Shecter, http://www.python.org/doc/current/ref/customization.html#l2h-130
Python's '==' seems to be similar to Java's 'equals()', since the first
object's __cmp__ method is called to evaluate equality. Python's 'is'
operator seems to be similar Java's '==' operator, as 'is' tests the
object's identity.
If the first object in Python's '==' operator does not have a __cmp__
method defined, the '==' operator falls back to testing for object
identity.