diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
commit | 458120dd40db6b4df55a4e96b650e16798ef06a0 (patch) | |
tree | 8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Doc/lib/libpickletools.tex | |
parent | 3a742c699f6806c1145aea5149bf15de15a0afd7 (diff) |
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Doc/lib/libpickletools.tex')
-rw-r--r-- | sys/src/cmd/python/Doc/lib/libpickletools.tex | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Doc/lib/libpickletools.tex b/sys/src/cmd/python/Doc/lib/libpickletools.tex new file mode 100644 index 000000000..8f6362621 --- /dev/null +++ b/sys/src/cmd/python/Doc/lib/libpickletools.tex @@ -0,0 +1,34 @@ +\section{\module{pickletools} --- Tools for pickle developers.} + +\declaremodule{standard}{pickletools} +\modulesynopsis{Contains extensive comments about the pickle protocols and pickle-machine opcodes, as well as some useful functions.} + +\versionadded{2.3} + +This module contains various constants relating to the intimate +details of the \refmodule{pickle} module, some lengthy comments about +the implementation, and a few useful functions for analyzing pickled +data. The contents of this module are useful for Python core +developers who are working on the \module{pickle} and \module{cPickle} +implementations; ordinary users of the \module{pickle} module probably +won't find the \module{pickletools} module relevant. + +\begin{funcdesc}{dis}{pickle\optional{, out=None, memo=None, indentlevel=4}} +Outputs a symbolic disassembly of the pickle to the file-like object +\var{out}, defaulting to \code{sys.stdout}. \var{pickle} can be a +string or a file-like object. \var{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 \code{MARK} opcodes in the stream, are +indented by \var{indentlevel} spaces. +\end{funcdesc} + +\begin{funcdesc}{genops}{pickle} +Provides an iterator over all of the opcodes in a pickle, returning a +sequence of \code{(\var{opcode}, \var{arg}, \var{pos})} triples. +\var{opcode} is an instance of an \class{OpcodeInfo} class; \var{arg} +is the decoded value, as a Python object, of the opcode's argument; +\var{pos} is the position at which this opcode is located. +\var{pickle} can be a string or a file-like object. +\end{funcdesc} + |