add __repr__ to Hostmask

This commit is contained in:
jesopo 2020-03-11 20:22:44 +00:00
parent 9cd39ddcdc
commit f1a1079873
1 changed files with 3 additions and 0 deletions

View File

@ -22,6 +22,9 @@ class Hostmask(object):
def __str__(self) -> str:
return self._raw
def __repr__(self) -> str:
return (f"Hostmask(nick={self.nickname}, user={self.username}"
f", host={self.hostname})")
def __eq__(self, other) -> bool:
if isinstance(other, Hostmask):
return str(self) == str(other)