'Equality comparison.
L{JID}s compare equal if their user, host and resource parts all
compare equal.  When comparing against instances of other types, it
uses the default comparison.'

def __eq__(self, other):

    if isinstance(other, JID):
        return ((self.user == other.user) and (self.host == other.host) and (self.resource == other.resource))
    else:
        return NotImplemented
