summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2010-07-03 07:36:51 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2010-07-03 07:36:51 (GMT)
commit5c8b54eb04490da53d4ed0d405d7151d4962ee19 (patch)
tree8155b37356be20d4b6904f4cf498a55fcf041033 /Doc
parent9bf2b3ae6a21c254bdd0d8f2dfbebd320494452e (diff)
downloadcpython-5c8b54eb04490da53d4ed0d405d7151d4962ee19.zip
cpython-5c8b54eb04490da53d4ed0d405d7151d4962ee19.tar.gz
cpython-5c8b54eb04490da53d4ed0d405d7151d4962ee19.tar.bz2
Issue 6507: accept source strings directly in dis.dis(). Original patch by Daniel Urban
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dis.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/dis.rst b/Doc/library/dis.rst
index c9417ea..807ee8b 100644
--- a/Doc/library/dis.rst
+++ b/Doc/library/dis.rst
@@ -33,10 +33,13 @@ The :mod:`dis` module defines the following functions and constants:
.. function:: dis(x=None)
Disassemble the *x* object. *x* can denote either a module, a
- class, a method, a function, or a code object. For a module, it disassembles
- all functions. For a class, it disassembles all methods. For a single code
- sequence, it prints one line per bytecode instruction. If no object is
- provided, it disassembles the last traceback.
+ class, a method, a function, a code object, a string of source code or a
+ byte sequence of raw bytecode. For a module, it disassembles all
+ functions. For a class, it disassembles all methods. For a code object
+ or sequence of raw bytecode, it prints one line per bytecode instruction.
+ Strings are first compiled to code objects with the :func:`compile`
+ built-in function before being disassembled. If no object is provided,
+ this function disassembles the last traceback.
.. function:: distb(tb=None)