mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #9268: Add annotation option to pickletools.dis
This commit is contained in:
parent
f4e7a35d64
commit
929d384058
3 changed files with 54 additions and 12 deletions
|
@ -13,14 +13,18 @@ ordinary users of the :mod:`pickle` module probably won't find the
|
|||
:mod:`pickletools` module relevant.
|
||||
|
||||
|
||||
.. function:: dis(pickle, out=None, memo=None, indentlevel=4)
|
||||
.. function:: dis(pickle, out=None, memo=None, indentlevel=4, annotate=0)
|
||||
|
||||
Outputs a symbolic disassembly of the pickle to the file-like object *out*,
|
||||
defaulting to ``sys.stdout``. *pickle* can be a string or a file-like object.
|
||||
*memo* can be a Python dictionary that will be used as the pickle's memo; it can
|
||||
be used to perform disassemblies across multiple pickles created by the same
|
||||
pickler. Successive levels, indicated by ``MARK`` opcodes in the stream, are
|
||||
indented by *indentlevel* spaces.
|
||||
Outputs a symbolic disassembly of the pickle to the file-like
|
||||
object *out*, defaulting to ``sys.stdout``. *pickle* can be a
|
||||
string or a file-like object. *memo* can be a Python dictionary
|
||||
that will be used as the pickle's memo; it can be used to perform
|
||||
disassemblies across multiple pickles created by the same
|
||||
pickler. Successive levels, indicated by ``MARK`` opcodes in the
|
||||
stream, are indented by *indentlevel* spaces. If a nonzero value
|
||||
is given to *annotate*, each opcode in the output is annotated with
|
||||
a short description. The value of *annotate* is used as a hint for
|
||||
the column where annotation should start.
|
||||
|
||||
.. function:: genops(pickle)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue