VMM/EmailAddress: implemented EmailAddress.__hash__().
So we can have a set() of EmailAddress instances.
--- a/VirtualMailManager/EmailAddress.py Sat Feb 27 06:24:20 2010 +0000
+++ b/VirtualMailManager/EmailAddress.py Sat Feb 27 09:28:33 2010 +0000
@@ -50,6 +50,9 @@
self._domainname != other.domainname
return NotImplemented
+ def __hash__(self):
+ return hash((self._localpart.lower(), self._domainname.lower()))
+
def __repr__(self):
return "EmailAddress('%s@%s')" % (self._localpart, self._domainname)