We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71f5b39 commit c3c6202Copy full SHA for c3c6202
Week05/emails_ege_enc.py
@@ -0,0 +1,24 @@
1
+class Emails(list):
2
+ def __init__(self, emails_list):
3
+ self.validate(emails_list)
4
+ unique_emails = list(dict.fromkeys(emails_list))
5
+ super().__init__(unique_emails)
6
+ self.data = self
7
+
8
+ def validate(self, emails_list):
9
+ for email in emails_list:
10
+ if not isinstance(email, str):
11
+ raise ValueError
12
13
+ if "@" not in email:
14
15
16
+ parts = email.split("@")
17
+ if len(parts) != 2 or "." not in parts[1]:
18
19
20
+ def __repr__(self):
21
+ return f"Emails({super().__repr__()})"
22
23
+ def __str__(self):
24
+ return super().__str__()
0 commit comments