Skip to content

Commit e73dfcd

Browse files
committed
Document stack effect APIs.
1 parent 92972ae commit e73dfcd

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

Doc/c-api/veryhigh.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,40 @@ Available start symbols
396396
* :pep:`484`
397397
398398
.. versionadded:: 3.8
399+
400+
401+
Stack Effects
402+
^^^^^^^^^^^^^
403+
404+
.. seealso::
405+
:py:func:`dis.stack_effect`
406+
407+
408+
.. c:macro:: PY_INVALID_STACK_EFFECT
409+
410+
Sentinel value representing an invalid stack effect.
411+
412+
This is currently equivalent to ``INT_MAX``.
413+
414+
.. versionadded:: 3.8
415+
416+
417+
.. c:function:: int PyCompile_OpcodeStackEffect(int opcode, int oparg)
418+
419+
Compute the stack effect of *opcode* with argument *oparg*.
420+
421+
On success, this function returns the stack effect; on failure, this
422+
returns :c:macro:`PY_INVALID_STACK_EFFECT`.
423+
424+
.. versionadded:: 3.4
425+
426+
427+
.. c:function:: int PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg)
428+
429+
Similar to :c:func:`PyCompile_OpcodeStackEffect`, but also includes the
430+
stack effect of jumping.
431+
432+
On success, this function returns the stack effect; on failure, this
433+
returns :c:macro:`PY_INVALID_STACK_EFFECT`.
434+
435+
.. versionadded:: 3.8

0 commit comments

Comments
 (0)