From 94bf17ac16f6d8d7eefd768d0ed3b04ef67fdd4a Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 09:36:04 +0800 Subject: [PATCH 01/20] Document BUILD_TEMPLATE --- Doc/library/dis.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 11685a32f48e4f..e652523f6b631f 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1162,6 +1162,13 @@ iterations of the loop. .. versionadded:: 3.6 +.. opcode:: BUILD_TEMPLATE + + Create a :class:`~string.templatelib.Template` object consuming interpolations + and a string from the stack, and pushes the resulting template onto the stack. + + .. versionadded:: 3.14 + .. opcode:: LIST_EXTEND (i) From 43f3a54afafe6761586c228ae264a9bd9b1c03a6 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 09:41:25 +0800 Subject: [PATCH 02/20] Add newline --- Doc/library/dis.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e652523f6b631f..0d50e9d2d2aeaa 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1162,6 +1162,7 @@ iterations of the loop. .. versionadded:: 3.6 + .. opcode:: BUILD_TEMPLATE Create a :class:`~string.templatelib.Template` object consuming interpolations From 528ca6f50cb41018ae5229de63bc05dd9861bc9c Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:33:51 +0800 Subject: [PATCH 03/20] Document BUILD_INTERPOLATION --- Doc/library/dis.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 0d50e9d2d2aeaa..e8d4ca8eb5b972 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1163,6 +1163,18 @@ iterations of the loop. .. versionadded:: 3.6 +.. opcode:: BUILD_INTERPOLATION + + Constructs an :class:`~string.templatelib.Interpolation` object from the + following components, and pushes it onto the stack: + + * value: the evaluated result at runtime + * name: the expression's source code as a string + * format: the format specification + + .. versionadded:: 3.14 + + .. opcode:: BUILD_TEMPLATE Create a :class:`~string.templatelib.Template` object consuming interpolations From f1c458565f0c0ec64bc043814256c46ccf6e61eb Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:36:29 +0800 Subject: [PATCH 04/20] Use it --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e8d4ca8eb5b972..7debc359be67a5 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1178,7 +1178,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE Create a :class:`~string.templatelib.Template` object consuming interpolations - and a string from the stack, and pushes the resulting template onto the stack. + and a string from the stack, and pushes it onto the stack. .. versionadded:: 3.14 From 7bb0dc53daf2326fb2720a40e5fb551378812ec5 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:57:33 +0800 Subject: [PATCH 05/20] Document NOT_TAKEN --- Doc/library/dis.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 7debc359be67a5..6e19d296e5fab8 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -585,6 +585,12 @@ operations on it as if it was a Python list. The top of the stack corresponds to generate line tracing events. +.. opcode:: NOT_TAKEN + Do nothing code. Used as a hint to the interpreter that a branch was predicted + as not taken. + .. versionadded:: 3.14 + + .. opcode:: POP_TOP Removes the top-of-stack item:: @@ -1168,9 +1174,9 @@ iterations of the loop. Constructs an :class:`~string.templatelib.Interpolation` object from the following components, and pushes it onto the stack: - * value: the evaluated result at runtime - * name: the expression's source code as a string - * format: the format specification + * ``value``: the evaluated result at runtime + * ``name``: the expression's source code as a string + * ``format``: the format specification .. versionadded:: 3.14 From bdd8855fa82f4f20f1113ff06b20630fe72e2f60 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 11:23:09 +0800 Subject: [PATCH 06/20] Delete refs --- Doc/library/dis.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 6e19d296e5fab8..6591ce76739087 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1171,8 +1171,8 @@ iterations of the loop. .. opcode:: BUILD_INTERPOLATION - Constructs an :class:`~string.templatelib.Interpolation` object from the - following components, and pushes it onto the stack: + Constructs an Interpolation object from the following components, and pushes + it onto the stack: * ``value``: the evaluated result at runtime * ``name``: the expression's source code as a string @@ -1183,8 +1183,8 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - Create a :class:`~string.templatelib.Template` object consuming interpolations - and a string from the stack, and pushes it onto the stack. + Create a Template object consuming interpolations and a string from the stack, + and pushes it onto the stack. .. versionadded:: 3.14 From ce4ffa6ced0c3e298597fe2bedd972dab04547d5 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:00:13 +0800 Subject: [PATCH 07/20] Fix according to bytecodes.c --- Doc/library/dis.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 6591ce76739087..fb2b94629ec145 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1171,20 +1171,21 @@ iterations of the loop. .. opcode:: BUILD_INTERPOLATION - Constructs an Interpolation object from the following components, and pushes - it onto the stack: + It expects as stack inputs (from top of stack down): - * ``value``: the evaluated result at runtime - * ``name``: the expression's source code as a string - * ``format``: the format specification + * ``format``: ``STACK[oparg & 1]`` + * ``str``: ``STACK[-1 - (oparg & 1)]`` + * ``value``: ``STACK[-2 - (oparg & 1)]`` + + It outputs the interpolation object to ``STACK[-1]`` after consuming its inputs. .. versionadded:: 3.14 .. opcode:: BUILD_TEMPLATE - Create a Template object consuming interpolations and a string from the stack, - and pushes it onto the stack. + It consumes ``STACK[-1]``(string) and ``STACK[-2]``(interpolations) and + outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From 2a05bc6f63853bd65eb641e2b5cad91dab64fc66 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:04:59 +0800 Subject: [PATCH 08/20] Fix lint --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index fb2b94629ec145..0534478804cf4b 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1184,7 +1184,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - It consumes ``STACK[-1]``(string) and ``STACK[-2]``(interpolations) and + It consumes ``STACK[-1]`` (string) and ``STACK[-2]`` (interpolations) and outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From c88907c92dda2ef2afbe17ce6143ba07287de478 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:08:21 +0800 Subject: [PATCH 09/20] Fix a small error --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 0534478804cf4b..a6d40d8f8ee802 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1184,7 +1184,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - It consumes ``STACK[-1]`` (string) and ``STACK[-2]`` (interpolations) and + It consumes ``STACK[-1]`` (interpolations) and ``STACK[-2]`` (strings) and outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From 265a88ae1dd62137bdae9297d9ff2c4f4c8eb601 Mon Sep 17 00:00:00 2001 From: Yongzi Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 21:24:14 +0800 Subject: [PATCH 10/20] Update Doc/library/dis.rst Co-authored-by: Ken Jin --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index a6d40d8f8ee802..9ebf5647624b4d 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1184,7 +1184,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - It consumes ``STACK[-1]`` (interpolations) and ``STACK[-2]`` (strings) and + Consumes ``STACK[-1]`` (interpolations) and ``STACK[-2]`` (strings) and outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From 2ddfa8e5c2d483fb2a9a7b339f637f818917731a Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 09:36:04 +0800 Subject: [PATCH 11/20] Document BUILD_TEMPLATE --- Doc/library/dis.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 11685a32f48e4f..e652523f6b631f 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1162,6 +1162,13 @@ iterations of the loop. .. versionadded:: 3.6 +.. opcode:: BUILD_TEMPLATE + + Create a :class:`~string.templatelib.Template` object consuming interpolations + and a string from the stack, and pushes the resulting template onto the stack. + + .. versionadded:: 3.14 + .. opcode:: LIST_EXTEND (i) From 0352fe3ed242a167b4dcd6144914de1044214ee5 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 09:41:25 +0800 Subject: [PATCH 12/20] Add newline --- Doc/library/dis.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e652523f6b631f..0d50e9d2d2aeaa 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1162,6 +1162,7 @@ iterations of the loop. .. versionadded:: 3.6 + .. opcode:: BUILD_TEMPLATE Create a :class:`~string.templatelib.Template` object consuming interpolations From d54d48791f9dfe6f7e21138fa0adb6d0284cbd60 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:33:51 +0800 Subject: [PATCH 13/20] Document BUILD_INTERPOLATION --- Doc/library/dis.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 0d50e9d2d2aeaa..e8d4ca8eb5b972 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1163,6 +1163,18 @@ iterations of the loop. .. versionadded:: 3.6 +.. opcode:: BUILD_INTERPOLATION + + Constructs an :class:`~string.templatelib.Interpolation` object from the + following components, and pushes it onto the stack: + + * value: the evaluated result at runtime + * name: the expression's source code as a string + * format: the format specification + + .. versionadded:: 3.14 + + .. opcode:: BUILD_TEMPLATE Create a :class:`~string.templatelib.Template` object consuming interpolations From 30b800781fee653beb9915c334261efafde31515 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:36:29 +0800 Subject: [PATCH 14/20] Use it --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index e8d4ca8eb5b972..7debc359be67a5 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1178,7 +1178,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE Create a :class:`~string.templatelib.Template` object consuming interpolations - and a string from the stack, and pushes the resulting template onto the stack. + and a string from the stack, and pushes it onto the stack. .. versionadded:: 3.14 From 7e53639bcbf40398c877b3533795965ae1cd0bf3 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 10:57:33 +0800 Subject: [PATCH 15/20] Document NOT_TAKEN --- Doc/library/dis.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 7debc359be67a5..6e19d296e5fab8 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -585,6 +585,12 @@ operations on it as if it was a Python list. The top of the stack corresponds to generate line tracing events. +.. opcode:: NOT_TAKEN + Do nothing code. Used as a hint to the interpreter that a branch was predicted + as not taken. + .. versionadded:: 3.14 + + .. opcode:: POP_TOP Removes the top-of-stack item:: @@ -1168,9 +1174,9 @@ iterations of the loop. Constructs an :class:`~string.templatelib.Interpolation` object from the following components, and pushes it onto the stack: - * value: the evaluated result at runtime - * name: the expression's source code as a string - * format: the format specification + * ``value``: the evaluated result at runtime + * ``name``: the expression's source code as a string + * ``format``: the format specification .. versionadded:: 3.14 From c51e87da710a48d5aed23a893e84ab91ad8a64a7 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 22 Jun 2025 11:23:09 +0800 Subject: [PATCH 16/20] Delete refs --- Doc/library/dis.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 6e19d296e5fab8..6591ce76739087 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1171,8 +1171,8 @@ iterations of the loop. .. opcode:: BUILD_INTERPOLATION - Constructs an :class:`~string.templatelib.Interpolation` object from the - following components, and pushes it onto the stack: + Constructs an Interpolation object from the following components, and pushes + it onto the stack: * ``value``: the evaluated result at runtime * ``name``: the expression's source code as a string @@ -1183,8 +1183,8 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - Create a :class:`~string.templatelib.Template` object consuming interpolations - and a string from the stack, and pushes it onto the stack. + Create a Template object consuming interpolations and a string from the stack, + and pushes it onto the stack. .. versionadded:: 3.14 From 1d79895c5806e234d5acd8bbf975532ca0fc052d Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:00:13 +0800 Subject: [PATCH 17/20] Fix according to bytecodes.c --- Doc/library/dis.rst | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 6591ce76739087..fb2b94629ec145 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1171,20 +1171,21 @@ iterations of the loop. .. opcode:: BUILD_INTERPOLATION - Constructs an Interpolation object from the following components, and pushes - it onto the stack: + It expects as stack inputs (from top of stack down): - * ``value``: the evaluated result at runtime - * ``name``: the expression's source code as a string - * ``format``: the format specification + * ``format``: ``STACK[oparg & 1]`` + * ``str``: ``STACK[-1 - (oparg & 1)]`` + * ``value``: ``STACK[-2 - (oparg & 1)]`` + + It outputs the interpolation object to ``STACK[-1]`` after consuming its inputs. .. versionadded:: 3.14 .. opcode:: BUILD_TEMPLATE - Create a Template object consuming interpolations and a string from the stack, - and pushes it onto the stack. + It consumes ``STACK[-1]``(string) and ``STACK[-2]``(interpolations) and + outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From e27966049e6c7889a05e82a099a95873768d092f Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:04:59 +0800 Subject: [PATCH 18/20] Fix lint --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index fb2b94629ec145..0534478804cf4b 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1184,7 +1184,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - It consumes ``STACK[-1]``(string) and ``STACK[-2]``(interpolations) and + It consumes ``STACK[-1]`` (string) and ``STACK[-2]`` (interpolations) and outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From 572b3a0722b2de9c1e363e8fd6f9908ad56baf0a Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Wed, 25 Jun 2025 20:08:21 +0800 Subject: [PATCH 19/20] Fix a small error --- Doc/library/dis.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 0534478804cf4b..a6d40d8f8ee802 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -1184,7 +1184,7 @@ iterations of the loop. .. opcode:: BUILD_TEMPLATE - It consumes ``STACK[-1]`` (string) and ``STACK[-2]`` (interpolations) and + It consumes ``STACK[-1]`` (interpolations) and ``STACK[-2]`` (strings) and outputs the template object to ``STACK[-1]``. .. versionadded:: 3.14 From a1ee14c44ab7b669d5b5a380c33869658128ceb7 Mon Sep 17 00:00:00 2001 From: Yzi-Li <204532581+Yzi-Li@users.noreply.github.com> Date: Sun, 6 Jul 2025 13:01:39 +0800 Subject: [PATCH 20/20] Add POP_ITER --- Doc/library/dis.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst index 9ebf5647624b4d..1889b4b585f133 100644 --- a/Doc/library/dis.rst +++ b/Doc/library/dis.rst @@ -598,6 +598,11 @@ operations on it as if it was a Python list. The top of the stack corresponds to STACK.pop() +.. opcode:: POP_ITER + + Removes the iterator from the top of the stack. + + .. opcode:: END_FOR Removes the top-of-stack item. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy