summaryrefslogtreecommitdiffstats
path: root/Doc/library/dis.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-09-18 06:54:26 (GMT)
committerGitHub <noreply@github.com>2018-09-18 06:54:26 (GMT)
commit7bdf28265aa371b39f82dfc6562635801aff15a5 (patch)
tree594df8e94f169b57113ace706e148ddffa5b61a2 /Doc/library/dis.rst
parentb042cf10c6084d14279c55a7e0d2d7595ff4e694 (diff)
downloadcpython-7bdf28265aa371b39f82dfc6562635801aff15a5.zip
cpython-7bdf28265aa371b39f82dfc6562635801aff15a5.tar.gz
cpython-7bdf28265aa371b39f82dfc6562635801aff15a5.tar.bz2
bpo-32455: Add jump parameter to dis.stack_effect(). (GH-6610)
Add C API function PyCompile_OpcodeStackEffectWithJump().
Diffstat (limited to 'Doc/library/dis.rst')
-rw-r--r--Doc/library/dis.rst11
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index 9564937..fe9979d 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -248,12 +248,21 @@ operation is being performed, so the intermediate analysis object isn't useful:
return a list of these offsets.
-.. function:: stack_effect(opcode, [oparg])
+.. function:: stack_effect(opcode, oparg=None, *, jump=None)
Compute the stack effect of *opcode* with argument *oparg*.
+ If the code has a jump target and *jump* is ``True``, :func:`~stack_effect`
+ will return the stack effect of jumping. If *jump* is ``False``,
+ it will return the stack effect of not jumping. And if *jump* is
+ ``None`` (default), it will return the maximal stack effect of both cases.
+
.. versionadded:: 3.4
+ .. versionchanged:: 3.8
+ Added *jump* parameter.
+
+
.. _bytecodes:
Python Bytecode Instructions