Skip to content

Commit 57b78a2

Browse files
committed
providers.py: Added email.address and email.__repr__
1 parent 5f2bd97 commit 57b78a2

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

tempmail/providers.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,17 @@ def get_domains() -> tuple[str, ...]:
7070
resp.raise_for_status()
7171
return tuple(resp.json())
7272

73-
def __str__(self) -> str:
73+
@property
74+
def address(self) -> str:
75+
"""The full email address"""
7476
return f'{self.username}@{self.domain}'
7577

78+
def __repr__(self) -> str:
79+
return f'<{self.__class__.__name__} address={self.address!r}>'
80+
81+
def __str__(self) -> str:
82+
return self.address
83+
7684
@dataclass
7785
class MessageInfo:
7886
id: int

0 commit comments

Comments
 (0)