VirtualMailManager/EmailAddress.py
branchv0.6.x
changeset 218 84094c7fa28b
parent 216 0c8c053b451c
child 253 58d1b6f41664
equal deleted inserted replaced
217:eecd05e31517 218:84094c7fa28b
    48         if isinstance(other, self.__class__):
    48         if isinstance(other, self.__class__):
    49             return self._localpart != other.localpart or \
    49             return self._localpart != other.localpart or \
    50                     self._domainname != other.domainname
    50                     self._domainname != other.domainname
    51         return NotImplemented
    51         return NotImplemented
    52 
    52 
       
    53     def __hash__(self):
       
    54         return hash((self._localpart.lower(), self._domainname.lower()))
       
    55 
    53     def __repr__(self):
    56     def __repr__(self):
    54         return "EmailAddress('%s@%s')" % (self._localpart, self._domainname)
    57         return "EmailAddress('%s@%s')" % (self._localpart, self._domainname)
    55 
    58 
    56     def __str__(self):
    59     def __str__(self):
    57         return '%s@%s' % (self._localpart, self._domainname)
    60         return '%s@%s' % (self._localpart, self._domainname)