Skip to content

Commit

Permalink
Update email.utils for 3.13 (#12336)
Browse files Browse the repository at this point in the history
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
  • Loading branch information
max-muoto and JelleZijlstra committed Jul 13, 2024
1 parent 4740d32 commit 35b84f2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 0 additions & 2 deletions stdlib/@tests/stubtest_allowlists/py313.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ ctypes.wintypes.PCHAR.from_param
ctypes.wintypes.PWCHAR.from_param
doctest.TestResults.__doc__
doctest.TestResults.__new__
email.utils.getaddresses
email.utils.parseaddr
filecmp.dircmp.__init__
importlib.resources.Anchor
importlib.resources.Resource
Expand Down
17 changes: 15 additions & 2 deletions stdlib/email/utils.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import sys
from _typeshed import Unused
from collections.abc import Iterable
from email import _ParamType
from email.charset import Charset
from typing import overload
Expand Down Expand Up @@ -28,9 +29,21 @@ _PDTZ: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int | None

def quote(str: str) -> str: ...
def unquote(str: str) -> str: ...
def parseaddr(addr: str | None) -> tuple[str, str]: ...

if sys.version_info >= (3, 13):
def parseaddr(addr: str | list[str], *, strict: bool = True) -> tuple[str, str]: ...

else:
def parseaddr(addr: str) -> tuple[str, str]: ...

def formataddr(pair: tuple[str | None, str], charset: str | Charset = "utf-8") -> str: ...
def getaddresses(fieldvalues: list[str]) -> list[tuple[str, str]]: ...

if sys.version_info >= (3, 13):
def getaddresses(fieldvalues: Iterable[str], *, strict: bool = True) -> list[tuple[str, str]]: ...

else:
def getaddresses(fieldvalues: Iterable[str]) -> list[tuple[str, str]]: ...

@overload
def parsedate(data: None) -> None: ...
@overload
Expand Down

0 comments on commit 35b84f2

Please sign in to comment.