summaryrefslogtreecommitdiffstats
path: root/Doc/libpickle.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-07-17 16:34:52 (GMT)
committerGuido van Rossum <guido@python.org>1997-07-17 16:34:52 (GMT)
commite47da0ae04814fab2a0aa6e637de2e4269978017 (patch)
tree1360ad7010b92c02d287e79accc1415c77bedc3e /Doc/libpickle.tex
parent3c2a056fdd3af1f3b94f134b0cab2bd8050c9703 (diff)
downloadcpython-e47da0ae04814fab2a0aa6e637de2e4269978017.zip
cpython-e47da0ae04814fab2a0aa6e637de2e4269978017.tar.gz
cpython-e47da0ae04814fab2a0aa6e637de2e4269978017.tar.bz2
AMK's megapatch:
* \bcode, \ecode added everywhere * \label{module-foo} added everywhere * A few \seealso sections added. * Indentation fixed inside verbatim in lib*tex files
Diffstat (limited to 'Doc/libpickle.tex')
-rw-r--r--Doc/libpickle.tex25
1 files changed, 13 insertions, 12 deletions
diff --git a/Doc/libpickle.tex b/Doc/libpickle.tex
index 128b29d..cb054a7 100644
--- a/Doc/libpickle.tex
+++ b/Doc/libpickle.tex
@@ -1,4 +1,5 @@
\section{Standard Module \sectcode{pickle}}
+\label{module-pickle}
\stmodindex{pickle}
\index{persistency}
\indexii{persistent}{objects}
@@ -133,30 +134,30 @@ The interface can be summarized as follows.
To pickle an object \code{x} onto a file \code{f}, open for writing:
-\begin{verbatim}
+\bcode\begin{verbatim}
p = pickle.Pickler(f)
p.dump(x)
-\end{verbatim}
-
+\end{verbatim}\ecode
+%
A shorthand for this is:
-\begin{verbatim}
+\bcode\begin{verbatim}
pickle.dump(x, f)
-\end{verbatim}
-
+\end{verbatim}\ecode
+%
To unpickle an object \code{x} from a file \code{f}, open for reading:
-\begin{verbatim}
+\bcode\begin{verbatim}
u = pickle.Unpickler(f)
x = u.load()
-\end{verbatim}
-
+\end{verbatim}\ecode
+%
A shorthand is:
-\begin{verbatim}
+\bcode\begin{verbatim}
x = pickle.load(f)
-\end{verbatim}
-
+\end{verbatim}\ecode
+%
The \code{Pickler} class only calls the method \code{f.write} with a
string argument. The \code{Unpickler} calls the methods \code{f.read}
(with an integer argument) and \code{f.readline} (without argument),