|
|
|
@ -48,8 +48,8 @@ compiled code. |
|
|
|
|
|
|
|
.. class:: Bytecode(x, *, first_line=None, current_offset=None) |
|
|
|
|
|
|
|
Analyse the bytecode corresponding to a function, method, string of |
|
|
|
source code, or a code object (as returned by :func:`compile`). |
|
|
|
Analyse the bytecode corresponding to a function, generator, method, |
|
|
|
string of source code, or a code object (as returned by :func:`compile`). |
|
|
|
|
|
|
|
This is a convenience wrapper around many of the functions listed below, |
|
|
|
most notably :func:`get_instructions`, as iterating over a |
|
|
|
@ -112,7 +112,7 @@ object isn't useful: |
|
|
|
.. 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. |
|
|
|
for the supplied function, generator, method, source code string or code object. |
|
|
|
|
|
|
|
Note that the exact contents of code info strings are highly implementation |
|
|
|
dependent and they may change arbitrarily across Python VMs or Python |
|
|
|
@ -139,11 +139,11 @@ object isn't useful: |
|
|
|
.. function:: dis(x=None, *, file=None) |
|
|
|
|
|
|
|
Disassemble the *x* object. *x* can denote either a module, a 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 |
|
|
|
method, a function, a generator, 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. |
|
|
|
|
|
|
|
|