source: vendor/python/2.5/Doc/lib/libpickletools.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.7 KB
Line 
1\section{\module{pickletools} --- Tools for pickle developers.}
2
3\declaremodule{standard}{pickletools}
4\modulesynopsis{Contains extensive comments about the pickle protocols and pickle-machine opcodes, as well as some useful functions.}
5
6\versionadded{2.3}
7
8This module contains various constants relating to the intimate
9details of the \refmodule{pickle} module, some lengthy comments about
10the implementation, and a few useful functions for analyzing pickled
11data. The contents of this module are useful for Python core
12developers who are working on the \module{pickle} and \module{cPickle}
13implementations; ordinary users of the \module{pickle} module probably
14won't find the \module{pickletools} module relevant.
15
16\begin{funcdesc}{dis}{pickle\optional{, out=None, memo=None, indentlevel=4}}
17Outputs a symbolic disassembly of the pickle to the file-like object
18\var{out}, defaulting to \code{sys.stdout}. \var{pickle} can be a
19string or a file-like object. \var{memo} can be a Python dictionary
20that will be used as the pickle's memo; it can be used to perform
21disassemblies across multiple pickles created by the same pickler.
22Successive levels, indicated by \code{MARK} opcodes in the stream, are
23indented by \var{indentlevel} spaces.
24\end{funcdesc}
25
26\begin{funcdesc}{genops}{pickle}
27Provides an iterator over all of the opcodes in a pickle, returning a
28sequence of \code{(\var{opcode}, \var{arg}, \var{pos})} triples.
29\var{opcode} is an instance of an \class{OpcodeInfo} class; \var{arg}
30is the decoded value, as a Python object, of the opcode's argument;
31\var{pos} is the position at which this opcode is located.
32\var{pickle} can be a string or a file-like object.
33\end{funcdesc}
34
Note: See TracBrowser for help on using the repository browser.