summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-09-10 14:08:04 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-09-10 14:08:04 (GMT)
commite8814fbb322ee6555a96dd8e173259c9c3b6a01a (patch)
tree8b1dde00a7588fc760ec576b7e185ad954df8615 /Doc
parentc02adca9996026c9f84a0e9079042dad27e3738a (diff)
downloadcpython-e8814fbb322ee6555a96dd8e173259c9c3b6a01a.zip
cpython-e8814fbb322ee6555a96dd8e173259c9c3b6a01a.tar.gz
cpython-e8814fbb322ee6555a96dd8e173259c9c3b6a01a.tar.bz2
As per python-dev discussion with Eli, properly document and publish dis.show_code
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst12
1 files changed, 11 insertions, 1 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index a377fc8..fb62ec1 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -36,7 +36,7 @@ the following command can be used to get the disassembly of :func:`myfunc`::
The :mod:`dis` module defines the following functions and constants:
-.. function:: code_info(x=None)
+.. function:: code_info(x)
Return a formatted multi-line string with detailed code object information
for the supplied function, method, source code string or code object.
@@ -48,6 +48,16 @@ The :mod:`dis` module defines the following functions and constants:
.. versionadded:: 3.2
+.. function:: show_code(x)
+
+ Print detailed code object information for the supplied function, method,
+ source code string or code object to stdout.
+
+ This is a convenient shorthand for ``print(code_info(x))``, intended for
+ interactive exploration at the interpreter prompt.
+
+ .. versionadded:: 3.2
+
.. function:: dis(x=None)
Disassemble the *x* object. *x* can denote either a module, a class, a