From d574139e6cd46b6b852ef0204e9f9aa6a8e316f0 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Tue, 27 May 2025 01:47:09 +0300 Subject: [PATCH] Update `builtins` to 3.14 (#14161) --- stdlib/@tests/stubtest_allowlists/py314.txt | 2 -- stdlib/builtins.pyi | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 80859a4df..db076fb76 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -8,8 +8,6 @@ _thread.RLock.locked _thread.set_name asyncio.eager_task_factory asyncio.tasks.eager_task_factory -builtins.bytearray.resize -builtins.int.__round__ compression.gzip.GzipFile.readinto compression.gzip.GzipFile.readinto compression.gzip.GzipFile.readinto1 diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 0912254f5..c483db872 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -331,7 +331,11 @@ class int: def __trunc__(self) -> int: ... def __ceil__(self) -> int: ... def __floor__(self) -> int: ... - def __round__(self, ndigits: SupportsIndex = ..., /) -> int: ... + if sys.version_info >= (3, 14): + def __round__(self, ndigits: SupportsIndex | None = None, /) -> int: ... + else: + def __round__(self, ndigits: SupportsIndex = ..., /) -> int: ... + def __getnewargs__(self) -> tuple[int]: ... def __eq__(self, value: object, /) -> bool: ... def __ne__(self, value: object, /) -> bool: ... @@ -844,6 +848,8 @@ class bytearray(MutableSequence[int]): def __alloc__(self) -> int: ... def __buffer__(self, flags: int, /) -> memoryview: ... def __release_buffer__(self, buffer: memoryview, /) -> None: ... + if sys.version_info >= (3, 14): + def resize(self, size: int, /) -> None: ... _IntegerFormats: TypeAlias = Literal[ "b", "B", "@b", "@B", "h", "H", "@h", "@H", "i", "I", "@i", "@I", "l", "L", "@l", "@L", "q", "Q", "@q", "@Q", "P", "@P"