mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
stdlib updates for latest Python patch releases (#12638)
This commit is contained in:
@@ -259,3 +259,11 @@ tkinter.EventType.__new__
|
||||
ctypes._endian.DEFAULT_MODE
|
||||
ctypes._endian.RTLD_GLOBAL
|
||||
ctypes._endian.RTLD_LOCAL
|
||||
|
||||
# Incompatible changes introduced in Python 3.10.15
|
||||
# (Remove once 3.10.15 becomes available for all platforms)
|
||||
(email._header_value_parser.NLSET)?
|
||||
(email._header_value_parser.SPECIALSNL)?
|
||||
(email.errors.HeaderWriteError)?
|
||||
(email.utils.getaddresses)?
|
||||
(email.utils.parseaddr)?
|
||||
|
||||
@@ -219,3 +219,11 @@ pkgutil.ImpLoader\..*
|
||||
ctypes._endian.DEFAULT_MODE
|
||||
ctypes._endian.RTLD_GLOBAL
|
||||
ctypes._endian.RTLD_LOCAL
|
||||
|
||||
# Incompatible changes introduced in Python 3.11.10
|
||||
# (Remove once 3.11.10 becomes available for all platforms)
|
||||
(email._header_value_parser.NLSET)?
|
||||
(email._header_value_parser.SPECIALSNL)?
|
||||
(email.errors.HeaderWriteError)?
|
||||
(email.utils.getaddresses)?
|
||||
(email.utils.parseaddr)?
|
||||
|
||||
@@ -202,8 +202,3 @@ ctypes._endian.SIZEOF_TIME_T
|
||||
|
||||
# Incompatible changes introduced in Python 3.12.5
|
||||
concurrent.futures.__all__
|
||||
email._header_value_parser.NLSET
|
||||
email._header_value_parser.SPECIALSNL
|
||||
email._policybase.Policy.verify_generated_headers
|
||||
email.errors.HeaderWriteError
|
||||
email.policy.Policy.verify_generated_headers
|
||||
|
||||
@@ -191,9 +191,3 @@ codecs.xmlcharrefreplace_errors
|
||||
|
||||
# To match `dict`, we lie about the runtime, but use overloads to match the correct behavior
|
||||
types.MappingProxyType.get
|
||||
|
||||
# logging.warn() was restored after the 3.13 release candidate, which is what CI is using
|
||||
logging.__all__
|
||||
logging.Logger.warn
|
||||
logging.LoggerAdapter.warn
|
||||
logging.warn
|
||||
|
||||
@@ -250,3 +250,11 @@ tkinter.EventType.__new__
|
||||
ctypes._endian.DEFAULT_MODE
|
||||
ctypes._endian.RTLD_GLOBAL
|
||||
ctypes._endian.RTLD_LOCAL
|
||||
|
||||
# Incompatible changes introduced in Python 3.8.20
|
||||
# (Remove once 3.8.20 becomes available for GitHub Actions)
|
||||
email._header_value_parser.NLSET
|
||||
email._header_value_parser.SPECIALSNL
|
||||
email.errors.HeaderWriteError
|
||||
email.utils.getaddresses
|
||||
email.utils.parseaddr
|
||||
|
||||
@@ -233,3 +233,11 @@ tkinter.EventType.__new__
|
||||
ctypes._endian.DEFAULT_MODE
|
||||
ctypes._endian.RTLD_GLOBAL
|
||||
ctypes._endian.RTLD_LOCAL
|
||||
|
||||
# Incompatible changes introduced in Python 3.9.20
|
||||
# (Remove once 3.9.20 becomes available for all platforms)
|
||||
(email._header_value_parser.NLSET)?
|
||||
(email._header_value_parser.SPECIALSNL)?
|
||||
(email.errors.HeaderWriteError)?
|
||||
(email.utils.getaddresses)?
|
||||
(email.utils.parseaddr)?
|
||||
|
||||
@@ -16,6 +16,10 @@ TOKEN_ENDS: Final[set[str]]
|
||||
ASPECIALS: Final[set[str]]
|
||||
ATTRIBUTE_ENDS: Final[set[str]]
|
||||
EXTENDED_ATTRIBUTE_ENDS: Final[set[str]]
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
NLSET: Final[set[str]]
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
SPECIALSNL: Final[set[str]]
|
||||
|
||||
def quote_string(value: Any) -> str: ...
|
||||
|
||||
|
||||
@@ -3,12 +3,34 @@ from collections.abc import Callable
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
from email.message import Message
|
||||
from typing import Any
|
||||
from typing_extensions import Self
|
||||
|
||||
class _PolicyBase:
|
||||
def __add__(self, other: Any) -> Self: ...
|
||||
def clone(self, **kw: Any) -> Self: ...
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_line_length: int | None = 78,
|
||||
linesep: str = "\n",
|
||||
cte_type: str = "8bit",
|
||||
raise_on_defect: bool = False,
|
||||
mangle_from_: bool = ..., # default depends on sub-class
|
||||
message_factory: Callable[[Policy], Message] | None = None,
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
verify_generated_headers: bool = True,
|
||||
) -> None: ...
|
||||
def clone(
|
||||
self,
|
||||
*,
|
||||
max_line_length: int | None = ...,
|
||||
linesep: str = ...,
|
||||
cte_type: str = ...,
|
||||
raise_on_defect: bool = ...,
|
||||
mangle_from_: bool = ...,
|
||||
message_factory: Callable[[Policy], Message] | None = ...,
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
verify_generated_headers: bool = ...,
|
||||
) -> Self: ...
|
||||
def __add__(self, other: Policy) -> Self: ...
|
||||
|
||||
class Policy(_PolicyBase, metaclass=ABCMeta):
|
||||
max_line_length: int | None
|
||||
@@ -17,16 +39,9 @@ class Policy(_PolicyBase, metaclass=ABCMeta):
|
||||
raise_on_defect: bool
|
||||
mangle_from_: bool
|
||||
message_factory: Callable[[Policy], Message] | None
|
||||
def __init__(
|
||||
self,
|
||||
*,
|
||||
max_line_length: int | None = 78,
|
||||
linesep: str = "\n",
|
||||
cte_type: str = "8bit",
|
||||
raise_on_defect: bool = False,
|
||||
mangle_from_: bool = False,
|
||||
message_factory: Callable[[Policy], Message] | None = None,
|
||||
) -> None: ...
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
verify_generated_headers: bool
|
||||
|
||||
def handle_defect(self, obj: Message, defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message, defect: MessageDefect) -> None: ...
|
||||
def header_max_count(self, name: str) -> int | None: ...
|
||||
|
||||
@@ -7,6 +7,9 @@ class BoundaryError(MessageParseError): ...
|
||||
class MultipartConversionError(MessageError, TypeError): ...
|
||||
class CharsetError(MessageError): ...
|
||||
|
||||
# Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
class HeaderWriteError(MessageError): ...
|
||||
|
||||
class MessageDefect(ValueError):
|
||||
def __init__(self, line: str | None = None) -> None: ...
|
||||
|
||||
|
||||
@@ -30,20 +30,12 @@ _PDTZ: TypeAlias = tuple[int, int, int, int, int, int, int, int, int, int | None
|
||||
def quote(str: str) -> str: ...
|
||||
def unquote(str: 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]: ...
|
||||
|
||||
# `strict` parameter added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
def parseaddr(addr: str | list[str], *, strict: bool = True) -> tuple[str, str]: ...
|
||||
def formataddr(pair: tuple[str | None, str], charset: str | Charset = "utf-8") -> 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]]: ...
|
||||
|
||||
# `strict` parameter added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
|
||||
def getaddresses(fieldvalues: Iterable[str], *, strict: bool = True) -> list[tuple[str, str]]: ...
|
||||
@overload
|
||||
def parsedate(data: None) -> None: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user