From 6deddd7e200fb04d00adff796c4338c201ad82ea Mon Sep 17 00:00:00 2001 From: Semyon Moroz Date: Tue, 13 May 2025 15:15:11 +0000 Subject: [PATCH] Add `dis.Instruction.make` for 3.14 (#14039) --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 - stdlib/dis.pyi | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 516ef9a31..eac9334bc 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -58,7 +58,6 @@ ctypes.wintypes.HDROP ctypes.wintypes.HFILE ctypes.wintypes.HRESULT ctypes.wintypes.HSZ -dis.Instruction.make enum.Enum.__signature__ enum.EnumMeta.__signature__ enum.EnumType.__signature__ diff --git a/stdlib/dis.pyi b/stdlib/dis.pyi index afd5e00ca..86b6d01e3 100644 --- a/stdlib/dis.pyi +++ b/stdlib/dis.pyi @@ -106,6 +106,21 @@ class Instruction(_Instruction): def jump_target(self) -> int: ... @property def is_jump_target(self) -> bool: ... + if sys.version_info >= (3, 14): + @staticmethod + def make( + opname: str, + arg: int | None, + argval: Any, + argrepr: str, + offset: int, + start_offset: int, + starts_line: bool, + line_number: int | None, + label: int | None = None, + positions: Positions | None = None, + cache_info: list[tuple[str, int, Any]] | None = None, + ) -> Instruction: ... class Bytecode: codeobj: types.CodeType