diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt index a28d6c091..d76c31595 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt @@ -2,11 +2,6 @@ # >= 3.13 # ======= -# TODO: New in 3.13.1 -_socket.SO_BINDTODEVICE -socket.__all__ -socket.SO_BINDTODEVICE - # Depends on HAVE_NCURSESW and how we install CPython, # should be removed when 3.13 will be officially released: _?curses.unget_wch diff --git a/stdlib/@tests/stubtest_allowlists/py312.txt b/stdlib/@tests/stubtest_allowlists/py312.txt index a2c20a83d..9ae160e7e 100644 --- a/stdlib/@tests/stubtest_allowlists/py312.txt +++ b/stdlib/@tests/stubtest_allowlists/py312.txt @@ -2,13 +2,6 @@ # New errors in Python 3.12 # ========================= -# TODO: New in 3.12.8 -argparse.ArgumentParser._parse_known_args -concurrent.futures.process._SafeQueue.__init__ -pickletools.read_stringnl -token.__all__ -tokenize.__all__ - # ======= # >= 3.12 diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index d3c930b26..4049026a4 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -2,14 +2,6 @@ # New errors in Python 3.13 # ========================= -# TODO: New in 3.13.1 -argparse.ArgumentParser._parse_known_args -codeop.Compile.__call__ -concurrent.futures.process._SafeQueue.__init__ -pickletools.read_stringnl -token.__all__ -tokenize.__all__ - # ======= # >= 3.13 diff --git a/stdlib/_socket.pyi b/stdlib/_socket.pyi index 36bc5c31c..4cf71cbca 100644 --- a/stdlib/_socket.pyi +++ b/stdlib/_socket.pyi @@ -78,8 +78,10 @@ if sys.platform == "win32": SO_EXCLUSIVEADDRUSE: int if sys.platform != "win32": SO_REUSEPORT: int + if sys.platform != "darwin" or sys.version_info >= (3, 13): + SO_BINDTODEVICE: int + if sys.platform != "win32" and sys.platform != "darwin": - SO_BINDTODEVICE: int SO_DOMAIN: int SO_MARK: int SO_PASSCRED: int diff --git a/stdlib/argparse.pyi b/stdlib/argparse.pyi index b527998a6..365617077 100644 --- a/stdlib/argparse.pyi +++ b/stdlib/argparse.pyi @@ -237,7 +237,13 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): # undocumented def _get_optional_actions(self) -> list[Action]: ... def _get_positional_actions(self) -> list[Action]: ... - def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> tuple[Namespace, list[str]]: ... + if sys.version_info >= (3, 12): + def _parse_known_args( + self, arg_strings: list[str], namespace: Namespace, intermixed: bool + ) -> tuple[Namespace, list[str]]: ... + else: + def _parse_known_args(self, arg_strings: list[str], namespace: Namespace) -> tuple[Namespace, list[str]]: ... + def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ... def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ... def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ... diff --git a/stdlib/codeop.pyi b/stdlib/codeop.pyi index 6a51b7786..cfe52e9b3 100644 --- a/stdlib/codeop.pyi +++ b/stdlib/codeop.pyi @@ -1,3 +1,4 @@ +import sys from types import CodeType __all__ = ["compile_command", "Compile", "CommandCompiler"] @@ -6,7 +7,10 @@ def compile_command(source: str, filename: str = "", symbol: str = "singl class Compile: flags: int - def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... + if sys.version_info >= (3, 13): + def __call__(self, source: str, filename: str, symbol: str, flags: int = 0) -> CodeType: ... + else: + def __call__(self, source: str, filename: str, symbol: str) -> CodeType: ... class CommandCompiler: compiler: Compile diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index a1de3d679..97dc261be 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -72,9 +72,19 @@ class _CallItem: class _SafeQueue(Queue[Future[Any]]): pending_work_items: dict[int, _WorkItem[Any]] - shutdown_lock: Lock + if sys.version_info < (3, 12): + shutdown_lock: Lock thread_wakeup: _ThreadWakeup - if sys.version_info >= (3, 9): + if sys.version_info >= (3, 12): + def __init__( + self, + max_size: int | None = 0, + *, + ctx: BaseContext, + pending_work_items: dict[int, _WorkItem[Any]], + thread_wakeup: _ThreadWakeup, + ) -> None: ... + elif sys.version_info >= (3, 9): def __init__( self, max_size: int | None = 0, diff --git a/stdlib/pickletools.pyi b/stdlib/pickletools.pyi index 542172814..cdade08d3 100644 --- a/stdlib/pickletools.pyi +++ b/stdlib/pickletools.pyi @@ -1,3 +1,4 @@ +import sys from collections.abc import Callable, Iterator, MutableMapping from typing import IO, Any from typing_extensions import TypeAlias @@ -40,7 +41,13 @@ def read_uint8(f: IO[bytes]) -> int: ... uint8: ArgumentDescriptor -def read_stringnl(f: IO[bytes], decode: bool = True, stripquotes: bool = True) -> bytes | str: ... +if sys.version_info >= (3, 12): + def read_stringnl( + f: IO[bytes], decode: bool = True, stripquotes: bool = True, *, encoding: str = "latin-1" + ) -> bytes | str: ... + +else: + def read_stringnl(f: IO[bytes], decode: bool = True, stripquotes: bool = True) -> bytes | str: ... stringnl: ArgumentDescriptor diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index 92ec26c7e..ab22cced0 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -367,7 +367,6 @@ if sys.platform != "win32" and sys.platform != "darwin": IP_TRANSPARENT as IP_TRANSPARENT, IPX_TYPE as IPX_TYPE, SCM_CREDENTIALS as SCM_CREDENTIALS, - SO_BINDTODEVICE as SO_BINDTODEVICE, SO_DOMAIN as SO_DOMAIN, SO_MARK as SO_MARK, SO_PASSCRED as SO_PASSCRED, @@ -396,7 +395,6 @@ if sys.platform != "win32" and sys.platform != "darwin": __all__ += [ "IP_TRANSPARENT", "SCM_CREDENTIALS", - "SO_BINDTODEVICE", "SO_DOMAIN", "SO_MARK", "SO_PASSCRED", @@ -517,6 +515,11 @@ if sys.platform != "win32": "IPV6_RTHDRDSTOPTS", ] + if sys.platform != "darwin" or sys.version_info >= (3, 13): + from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE + + __all__ += ["SO_BINDTODEVICE"] + if sys.platform != "darwin" and sys.platform != "linux": if sys.platform != "win32" or sys.version_info >= (3, 9): from _socket import BDADDR_ANY as BDADDR_ANY, BDADDR_LOCAL as BDADDR_LOCAL, BTPROTO_RFCOMM as BTPROTO_RFCOMM diff --git a/stdlib/token.pyi b/stdlib/token.pyi index 668987d7c..741ce5b03 100644 --- a/stdlib/token.pyi +++ b/stdlib/token.pyi @@ -76,7 +76,7 @@ if sys.version_info >= (3, 10): __all__ += ["SOFT_KEYWORD"] if sys.version_info >= (3, 12): - __all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START"] + __all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START", "EXACT_TOKEN_TYPES"] ENDMARKER: int NAME: int diff --git a/stdlib/tokenize.pyi b/stdlib/tokenize.pyi index 7e9a945cd..7b68f791a 100644 --- a/stdlib/tokenize.pyi +++ b/stdlib/tokenize.pyi @@ -88,7 +88,7 @@ if sys.version_info >= (3, 10): __all__ += ["SOFT_KEYWORD"] if sys.version_info >= (3, 12): - __all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START"] + __all__ += ["EXCLAMATION", "FSTRING_END", "FSTRING_MIDDLE", "FSTRING_START", "EXACT_TOKEN_TYPES"] if sys.version_info >= (3, 13): __all__ += ["TokenError", "open"]