Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9463de2

Browse files
committed
Document cPickle and cStringIO.
1 parent 10032eb commit 9463de2

6 files changed

Lines changed: 68 additions & 22 deletions

File tree

Doc/lib/libpickle.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,21 @@ \section{Standard Module \module{pickle}}
270270

271271
\seemodule{shelve}{indexed databases of objects; uses \module{pickle}}
272272
\end{seealso}
273+
274+
275+
\section{Built-in Module \module{cPickle}}
276+
\bimodindex{cPickle}
277+
\label{module-cPickle}
278+
279+
% This section was written by Fred L. Drake, Jr. <[email protected]>
280+
281+
The \module{cPickle} module provides a similar interface and identical
282+
functionality as the \module{pickle} module, but can be up to 1000
283+
times faster since it is implemented in \C{}. The only other
284+
important difference to note is that \function{Pickler()} and
285+
\function{Unpickler()} are functions and not classes, and so cannot be
286+
subclassed. This should not be an issue in most cases.
287+
288+
The format of the pickle data is identical to that produced using the
289+
\module{pickle} module, so it is possible to use \module{pickle} and
290+
\module{cPickle} interchangably with existing pickles.

Doc/lib/libstrio.tex

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,19 @@ \section{Standard Module \module{StringIO}}
2424
\begin{methoddesc}{close}{}
2525
Free the memory buffer.
2626
\end{methoddesc}
27+
28+
29+
\section{Built-in Module \module{cStringIO}}
30+
\bimodindex{cStringIO}
31+
\label{module-cStringIO}
32+
33+
% This section was written by Fred L. Drake, Jr. <[email protected]>
34+
35+
The module \module{cStringIO} provides an interface similar to that of
36+
the \module{StringIO} module. Heavy use of \class{StringIO.StringIO}
37+
objects can be made more efficient by using the function
38+
\function{StringIO()} from this module instead.
39+
40+
Since this module provides a factory function which returns objects of
41+
built-in types, there's no way to build your own version using
42+
subclassing. Use the original \module{StringIO} module in that case.

Doc/lib/libundoc.tex

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ \chapter{Undocumented Modules}
77
posting by Fredrik Lundh; I have revised some modules' status.)
88

99

10-
\section{Fundamental, and pretty straightforward to document}
11-
12-
\begin{description}
13-
\item[cPickle.c]
14-
--- mostly the same as pickle but no subclassing
15-
16-
\item[cStringIO.c]
17-
--- mostly the same as StringIO but no subclassing
18-
\end{description}
19-
20-
2110
\section{Frameworks; somewhat harder to document, but well worth the effort}
2211

2312
\begin{description}

Doc/libpickle.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,3 +270,21 @@ \section{Standard Module \module{pickle}}
270270

271271
\seemodule{shelve}{indexed databases of objects; uses \module{pickle}}
272272
\end{seealso}
273+
274+
275+
\section{Built-in Module \module{cPickle}}
276+
\bimodindex{cPickle}
277+
\label{module-cPickle}
278+
279+
% This section was written by Fred L. Drake, Jr. <[email protected]>
280+
281+
The \module{cPickle} module provides a similar interface and identical
282+
functionality as the \module{pickle} module, but can be up to 1000
283+
times faster since it is implemented in \C{}. The only other
284+
important difference to note is that \function{Pickler()} and
285+
\function{Unpickler()} are functions and not classes, and so cannot be
286+
subclassed. This should not be an issue in most cases.
287+
288+
The format of the pickle data is identical to that produced using the
289+
\module{pickle} module, so it is possible to use \module{pickle} and
290+
\module{cPickle} interchangably with existing pickles.

Doc/libstrio.tex

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,19 @@ \section{Standard Module \module{StringIO}}
2424
\begin{methoddesc}{close}{}
2525
Free the memory buffer.
2626
\end{methoddesc}
27+
28+
29+
\section{Built-in Module \module{cStringIO}}
30+
\bimodindex{cStringIO}
31+
\label{module-cStringIO}
32+
33+
% This section was written by Fred L. Drake, Jr. <[email protected]>
34+
35+
The module \module{cStringIO} provides an interface similar to that of
36+
the \module{StringIO} module. Heavy use of \class{StringIO.StringIO}
37+
objects can be made more efficient by using the function
38+
\function{StringIO()} from this module instead.
39+
40+
Since this module provides a factory function which returns objects of
41+
built-in types, there's no way to build your own version using
42+
subclassing. Use the original \module{StringIO} module in that case.

Doc/libundoc.tex

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ \chapter{Undocumented Modules}
77
posting by Fredrik Lundh; I have revised some modules' status.)
88

99

10-
\section{Fundamental, and pretty straightforward to document}
11-
12-
\begin{description}
13-
\item[cPickle.c]
14-
--- mostly the same as pickle but no subclassing
15-
16-
\item[cStringIO.c]
17-
--- mostly the same as StringIO but no subclassing
18-
\end{description}
19-
20-
2110
\section{Frameworks; somewhat harder to document, but well worth the effort}
2211

2312
\begin{description}

0 commit comments

Comments
 (0)