diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py315.txt b/stdlib/@tests/stubtest_allowlists/darwin-py315.txt index 3c2820e84ea2..6fd7c8bec893 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py315.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py315.txt @@ -2,14 +2,12 @@ # TODO: Allowlist entries that should be fixed # ============================================ -_decimal.SPEC_VERSION _pyrepl.fancy_termios _pyrepl.unix_console _pyrepl.unix_eventqueue ctypes.c_double_complex._type_ ctypes.c_float_complex._type_ ctypes.c_longdouble_complex._type_ -decimal.SPEC_VERSION mmap.MS_ASYNC mmap.MS_INVALIDATE mmap.MS_SYNC diff --git a/stdlib/@tests/stubtest_allowlists/py315.txt b/stdlib/@tests/stubtest_allowlists/py315.txt index 865a1c6bd0ca..2c36d4a6bfb2 100644 --- a/stdlib/@tests/stubtest_allowlists/py315.txt +++ b/stdlib/@tests/stubtest_allowlists/py315.txt @@ -17,8 +17,6 @@ _interpqueues.create _interpqueues.put _json.make_scanner.array_hook _json.scanstring -_pydecimal.SPEC_VERSION -_pydecimal.__all__ _pyrepl.base_eventqueue _pyrepl.commands _pyrepl.completing_reader @@ -80,9 +78,6 @@ ast.ImportFrom.is_lazy ast.dump ast.parse ast.type_param.__init__ -asyncio.taskgroups.TaskGroup.cancel -asyncio.tools.display_awaited_by_tasks_table -asyncio.tools.display_awaited_by_tasks_tree base64.a85decode base64.b16decode base64.b16encode @@ -118,7 +113,6 @@ binascii.b2a_base32 binascii.b2a_base64 binascii.b2a_base85 binascii.unhexlify -cProfile.label calendar.HTMLCalendar.formatmonthpage calendar.__all__ calendar.standalone_month_abbr @@ -154,9 +148,6 @@ datetime.datetime.fromisoformat datetime.datetime.strptime datetime.time.fromisoformat datetime.time.strptime -dbm.dumb._Database.reorganize -dbm.sqlite3.REORGANIZE -dbm.sqlite3._Database.reorganize difflib.unified_diff doctest.DocTestRunner.report_skip enum.__all__ @@ -284,7 +275,6 @@ profiling.sampling.sample profiling.sampling.stack_collector profiling.sampling.string_table profiling.tracing -pstats.Stats.print_call_subheading pydoc.Doc.STDLIB_DIR pydoc.Doc.getdocloc pyexpat.XMLParserType.SetBillionLaughsAttackProtectionActivationThreshold @@ -341,7 +331,6 @@ sys.last_exc sys.lazy_modules sys.set_lazy_imports sys.set_lazy_imports_filter -sysconfig.is_python_build tarfile.TarFile.__init__ threading.Condition.locked threading.__all__ diff --git a/stdlib/@tests/stubtest_allowlists/win32-py315.txt b/stdlib/@tests/stubtest_allowlists/win32-py315.txt index c8d924c64747..18c57b019a8f 100644 --- a/stdlib/@tests/stubtest_allowlists/win32-py315.txt +++ b/stdlib/@tests/stubtest_allowlists/win32-py315.txt @@ -2,7 +2,6 @@ # TODO: Allowlist entries that should be fixed # ============================================ -_decimal.SPEC_VERSION _socket.IPV6_HDRINCL _winapi.DeregisterEventSource _winapi.EVENTLOG_AUDIT_FAILURE @@ -15,7 +14,6 @@ _winapi.GetOEMCP _winapi.RegisterEventSource _winapi.ReportEvent asyncio.windows_events.IocpProactor.finish_socket_func -decimal.SPEC_VERSION socket.IPV6_HDRINCL socket.__all__ winreg.DeleteTree diff --git a/stdlib/_decimal.pyi b/stdlib/_decimal.pyi index ab1acdc74a1b..75d5be277f95 100644 --- a/stdlib/_decimal.pyi +++ b/stdlib/_decimal.pyi @@ -25,6 +25,8 @@ _TrapType: TypeAlias = type[DecimalException] __version__: Final[str] __libmpdec_version__: Final[str] +if sys.version_info >= (3, 15): + SPEC_VERSION: Final[str] ROUND_DOWN: Final = "ROUND_DOWN" ROUND_HALF_UP: Final = "ROUND_HALF_UP" diff --git a/stdlib/_pydecimal.pyi b/stdlib/_pydecimal.pyi index a6723f749da6..9fabcc640096 100644 --- a/stdlib/_pydecimal.pyi +++ b/stdlib/_pydecimal.pyi @@ -45,3 +45,6 @@ __all__ = [ if sys.version_info >= (3, 14): __all__ += ["IEEEContext", "IEEE_CONTEXT_MAX_BITS"] + +if sys.version_info >= (3, 15): + __all__ += ["SPEC_VERSION"] diff --git a/stdlib/asyncio/taskgroups.pyi b/stdlib/asyncio/taskgroups.pyi index 2968b0719761..886a79c4beb5 100644 --- a/stdlib/asyncio/taskgroups.pyi +++ b/stdlib/asyncio/taskgroups.pyi @@ -37,3 +37,5 @@ class TaskGroup: ) -> Task[_T]: ... def _on_task_done(self, task: Task[object]) -> None: ... + if sys.version_info >= (3, 15): + def cancel(self) -> None: ... diff --git a/stdlib/asyncio/tools.pyi b/stdlib/asyncio/tools.pyi index bc8b809b9c05..36c65541c9cd 100644 --- a/stdlib/asyncio/tools.pyi +++ b/stdlib/asyncio/tools.pyi @@ -42,5 +42,10 @@ def build_task_table(result: Iterable[_AwaitedInfo]) -> list[list[int | str]]: . if sys.version_info >= (3, 14): def exit_with_permission_help_text() -> None: ... -def display_awaited_by_tasks_table(pid: SupportsIndex) -> None: ... -def display_awaited_by_tasks_tree(pid: SupportsIndex) -> None: ... +if sys.version_info >= (3, 15): + def display_awaited_by_tasks_table(pid: SupportsIndex, retries: SupportsIndex = 3) -> None: ... + def display_awaited_by_tasks_tree(pid: SupportsIndex, retries: SupportsIndex = 3) -> None: ... + +else: + def display_awaited_by_tasks_table(pid: SupportsIndex) -> None: ... + def display_awaited_by_tasks_tree(pid: SupportsIndex) -> None: ... diff --git a/stdlib/cProfile.pyi b/stdlib/cProfile.pyi index 37ec9689c46d..0e414206f515 100644 --- a/stdlib/cProfile.pyi +++ b/stdlib/cProfile.pyi @@ -1,4 +1,5 @@ import _lsprof +import sys from _typeshed import StrOrBytesPath, Unused from collections.abc import Callable, Mapping from types import CodeType @@ -28,4 +29,5 @@ class Profile(_lsprof.Profiler): def __enter__(self) -> Self: ... def __exit__(self, *exc_info: Unused) -> None: ... -def label(code: str | CodeType) -> _Label: ... # undocumented +if sys.version_info < (3, 15): + def label(code: str | CodeType) -> _Label: ... # undocumented diff --git a/stdlib/dbm/dumb.pyi b/stdlib/dbm/dumb.pyi index fccca484a026..d5a769e6a1c2 100644 --- a/stdlib/dbm/dumb.pyi +++ b/stdlib/dbm/dumb.pyi @@ -18,6 +18,9 @@ error = OSError class _Database(MutableMapping[_KeyType, bytes]): def __init__(self, filebasename: str, mode: str, flag: str = "c") -> None: ... def sync(self) -> None: ... + if sys.version_info >= (3, 15): + def reorganize(self) -> None: ... + def iterkeys(self) -> Iterator[bytes]: ... # undocumented def close(self) -> None: ... def __getitem__(self, key: _KeyType) -> bytes: ... diff --git a/stdlib/dbm/sqlite3.pyi b/stdlib/dbm/sqlite3.pyi index 43d8c96895dd..e7034cfde50d 100644 --- a/stdlib/dbm/sqlite3.pyi +++ b/stdlib/dbm/sqlite3.pyi @@ -1,3 +1,4 @@ +import sys from _typeshed import ReadableBuffer, StrOrBytesPath, Unused from collections.abc import Generator, MutableMapping from typing import Final, Literal, TypeAlias @@ -9,6 +10,8 @@ LOOKUP_KEY: Final[LiteralString] STORE_KV: Final[LiteralString] DELETE_KEY: Final[LiteralString] ITER_KEYS: Final[LiteralString] +if sys.version_info >= (3, 15): + REORGANIZE: Final[LiteralString] _SqliteData: TypeAlias = str | ReadableBuffer | int | float @@ -25,5 +28,7 @@ class _Database(MutableMapping[bytes, bytes]): def keys(self) -> list[bytes]: ... # type: ignore[override] def __enter__(self) -> Self: ... def __exit__(self, *args: Unused) -> None: ... + if sys.version_info >= (3, 15): + def reorganize(self) -> None: ... def open(filename: StrOrBytesPath, /, flag: Literal["r", "w", "c", "n"] = "r", mode: int = 0o666) -> _Database: ... diff --git a/stdlib/decimal.pyi b/stdlib/decimal.pyi index e5c9360ada15..42cc2ff4eafb 100644 --- a/stdlib/decimal.pyi +++ b/stdlib/decimal.pyi @@ -31,6 +31,8 @@ from typing_extensions import Self, disjoint_base if sys.version_info >= (3, 14): from _decimal import IEEE_CONTEXT_MAX_BITS as IEEE_CONTEXT_MAX_BITS, IEEEContext as IEEEContext +if sys.version_info >= (3, 15): + from _decimal import SPEC_VERSION as SPEC_VERSION _Decimal: TypeAlias = Decimal | int _DecimalNew: TypeAlias = Decimal | float | str | tuple[int, Sequence[int], int] diff --git a/stdlib/pstats.pyi b/stdlib/pstats.pyi index 5b22b579c02a..d8a50571f1c1 100644 --- a/stdlib/pstats.pyi +++ b/stdlib/pstats.pyi @@ -86,6 +86,9 @@ class Stats: def print_callees(self, *amount: _Selector) -> Self: ... def print_callers(self, *amount: _Selector) -> Self: ... def print_call_heading(self, name_size: int, column_title: str) -> None: ... + if sys.version_info >= (3, 15): + def print_call_subheading(self, name_size: int) -> None: ... + def print_call_line(self, name_size: int, source: str, call_dict: dict[str, Any], arrow: str = "->") -> None: ... def print_title(self) -> None: ... def print_line(self, func: str) -> None: ... diff --git a/stdlib/sysconfig.pyi b/stdlib/sysconfig.pyi index 19268ebb33fc..1251fdc444ec 100644 --- a/stdlib/sysconfig.pyi +++ b/stdlib/sysconfig.pyi @@ -37,7 +37,10 @@ def get_paths(scheme: str = ..., vars: dict[str, Any] | None = None, expand: boo def get_python_version() -> str: ... def get_platform() -> str: ... -if sys.version_info >= (3, 12): +if sys.version_info >= (3, 15): + def is_python_build() -> bool: ... + +elif sys.version_info >= (3, 12): @overload def is_python_build() -> bool: ... @overload