Skip to content

Commit ce4ffa6

Browse files
committed
Fix according to bytecodes.c
1 parent bdd8855 commit ce4ffa6

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Doc/library/dis.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,20 +1171,21 @@ iterations of the loop.
11711171

11721172
.. opcode:: BUILD_INTERPOLATION
11731173

1174-
Constructs an Interpolation object from the following components, and pushes
1175-
it onto the stack:
1174+
It expects as stack inputs (from top of stack down):
11761175

1177-
* ``value``: the evaluated result at runtime
1178-
* ``name``: the expression's source code as a string
1179-
* ``format``: the format specification
1176+
* ``format``: ``STACK[oparg & 1]``
1177+
* ``str``: ``STACK[-1 - (oparg & 1)]``
1178+
* ``value``: ``STACK[-2 - (oparg & 1)]``
1179+
1180+
It outputs the interpolation object to ``STACK[-1]`` after consuming its inputs.
11801181

11811182
.. versionadded:: 3.14
11821183

11831184

11841185
.. opcode:: BUILD_TEMPLATE
11851186

1186-
Create a Template object consuming interpolations and a string from the stack,
1187-
and pushes it onto the stack.
1187+
It consumes ``STACK[-1]``(string) and ``STACK[-2]``(interpolations) and
1188+
outputs the template object to ``STACK[-1]``.
11881189

11891190
.. versionadded:: 3.14
11901191

0 commit comments

Comments
 (0)