|
8 | 8 | import unicodedata |
9 | 9 | import idna # implements IDNA 2008; Python's codec is only IDNA 2003 |
10 | 10 | import ipaddress |
11 | | -from typing import Optional, Tuple, TypedDict, Union |
| 11 | +from typing import Optional, TypedDict, Union |
12 | 12 |
|
13 | 13 |
|
14 | | -def split_email(email: str) -> Tuple[Optional[str], str, str, bool]: |
| 14 | +def split_email(email: str) -> tuple[Optional[str], str, str, bool]: |
15 | 15 | # Return the display name, unescaped local part, and domain part |
16 | 16 | # of the address, and whether the local part was quoted. If no |
17 | 17 | # display name was present and angle brackets do not surround |
@@ -47,7 +47,7 @@ def split_email(email: str) -> Tuple[Optional[str], str, str, bool]: |
47 | 47 | # We assume the input string is already stripped of leading and |
48 | 48 | # trailing CFWS. |
49 | 49 |
|
50 | | - def split_string_at_unquoted_special(text: str, specials: Tuple[str, ...]) -> Tuple[str, str]: |
| 50 | + def split_string_at_unquoted_special(text: str, specials: tuple[str, ...]) -> tuple[str, str]: |
51 | 51 | # Split the string at the first character in specials (an @-sign |
52 | 52 | # or left angle bracket) that does not occur within quotes and |
53 | 53 | # is not followed by a Unicode combining character. |
@@ -112,7 +112,7 @@ def split_string_at_unquoted_special(text: str, specials: Tuple[str, ...]) -> Tu |
112 | 112 |
|
113 | 113 | return left_part, right_part |
114 | 114 |
|
115 | | - def unquote_quoted_string(text: str) -> Tuple[str, bool]: |
| 115 | + def unquote_quoted_string(text: str) -> tuple[str, bool]: |
116 | 116 | # Remove surrounding quotes and unescape escaped backslashes |
117 | 117 | # and quotes. Escapes are parsed liberally. I think only |
118 | 118 | # backslashes and quotes can be escaped but we'll allow anything |
|
0 commit comments