From e7952dd68402488fb6139296f8241cea485d2746 Mon Sep 17 00:00:00 2001 From: Ragna1204 Date: Fri, 13 Jun 2025 21:21:51 +0530 Subject: [PATCH 1/2] Add 3.14 instructions and update CALL_FUNCTION_EX in dis docs --- Doc/library/dis.rst | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 44767b5dd2d5c9..e4e61377ccf17c 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -646,6 +646,26 @@ operations on it as if it was a Python list. The top of the stack corresponds to .. versionadded:: 3.11 +.. opcode:: BUILD_INTERPOLATION + + Push a new interpolated string constructed from format components on the stack. + + .. versionadded:: 3.14 + + +.. opcode:: LOAD_SMALL_INT (i) + + Push a small integer literal (−128 <= i <= 127) directly onto the stack. + + .. versionadded:: 3.14 + + +.. opcode:: NOT_TAKEN + + No-op; a hint to the interpreter that a branch was predicted as not taken. + + .. versionadded:: 3.14 + **Unary operations** @@ -1576,16 +1596,23 @@ iterations of the loop. .. opcode:: CALL_FUNCTION_EX (flags) Calls a callable object with variable set of positional and keyword - arguments. If the lowest bit of *flags* is set, the top of the stack + arguments. If the lowest bit of *flags* is set, the top of the stack contains a mapping object containing additional keyword arguments. Before the callable is called, the mapping object and iterable object are each "unpacked" and their contents passed in as keyword and positional arguments respectively. + + If the second bit of *flags* is set (new in 3.14), the call is made + in a specialized way to handle certain internal optimizations. + ``CALL_FUNCTION_EX`` pops all arguments and the callable object off the stack, - calls the callable object with those arguments, and pushes the return value + calls the callable with those arguments, and pushes the return value returned by the callable object. .. versionadded:: 3.6 + .. versionchanged:: 3.14 + The second bit of *flags* may now be set to enable specialized calls. + .. opcode:: PUSH_NULL From 0538503849392ee61aa703b3d2d189c1038ea341 Mon Sep 17 00:00:00 2001 From: Ragna1204 Date: Sat, 14 Jun 2025 12:38:42 +0530 Subject: [PATCH 2/2] Remove duplicated LOAD_SMALL_INT (i) opcode from dis.rst --- Doc/library/dis.rst | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e4e61377ccf17c..bd46d5b4a9a5b5 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1106,14 +1106,6 @@ iterations of the loop. Pushes ``co_consts[consti]`` onto the stack. -.. opcode:: LOAD_SMALL_INT (i) - - Pushes the integer ``i`` onto the stack. - ``i`` must be in ``range(256)`` - - .. versionadded:: 3.14 - - .. opcode:: LOAD_CONST_IMMORTAL (consti) Pushes ``co_consts[consti]`` onto the stack.