FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.13] gh-141004: Document stack effect C APIs (GH-141843) by miss-islington · Pull Request #141917 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
40 changes: 40 additions & 0 deletions Doc/c-api/veryhigh.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,43 @@ Available start symbols
* :pep:`484`

.. versionadded:: 3.8


Stack Effects
^^^^^^^^^^^^^

.. seealso::
:py:func:`dis.stack_effect`


.. c:macro:: PY_INVALID_STACK_EFFECT

Sentinel value representing an invalid stack effect.

This is currently equivalent to ``INT_MAX``.

.. versionadded:: 3.8


.. c:function:: int PyCompile_OpcodeStackEffect(int opcode, int oparg)

Compute the stack effect of *opcode* with argument *oparg*.

On success, this function returns the stack effect; on failure, this
returns :c:macro:`PY_INVALID_STACK_EFFECT`.

.. versionadded:: 3.4


.. c:function:: int PyCompile_OpcodeStackEffectWithJump(int opcode, int oparg, int jump)

Similar to :c:func:`PyCompile_OpcodeStackEffect`, but don't include the
stack effect of jumping if *jump* is zero.

If *jump* is ``0``, this will not include the stack effect of jumping, but
if *jump* is ``1`` or ``-1``, this will include it.

On success, this function returns the stack effect; on failure, this
returns :c:macro:`PY_INVALID_STACK_EFFECT`.

.. versionadded:: 3.8
Loading

Back | FazBrowse Home | New Git URL