diff options
author | Lance Stout <lancestout@gmail.com> | 2011-01-05 20:16:15 -0500 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2011-01-05 20:16:15 -0500 |
commit | 2908751020b61da5466ff15644628e29bd5bbd3a (patch) | |
tree | b911dd78b3e17d2c73818d939bba93259cac2605 /sleekxmpp/xmlstream/jid.py | |
parent | 8b29431cdeff5647208e3eab108bba9e9c8318fc (diff) | |
download | slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.tar.gz slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.tar.bz2 slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.tar.xz slixmpp-2908751020b61da5466ff15644628e29bd5bbd3a.zip |
Allow JID objects to be compared with strings.
Two JIDs match if they have the same full JID value.
Diffstat (limited to 'sleekxmpp/xmlstream/jid.py')
-rw-r--r-- | sleekxmpp/xmlstream/jid.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/jid.py b/sleekxmpp/xmlstream/jid.py index d8f45b92..e5c49dc0 100644 --- a/sleekxmpp/xmlstream/jid.py +++ b/sleekxmpp/xmlstream/jid.py @@ -124,3 +124,9 @@ class JID(object): def __repr__(self): return str(self) + + def __eq__(self, other): + """ + Two JIDs are considered equal if they have the same full JID value. + """ + return str(other) == str(self) |