Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update email.utils for 3.13 #12336

Merged
merged 6 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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