Commit 01553706 authored by Fred Drake's avatar Fred Drake

Added a few items to the "See also" sections at Guido's prompting. Made

more references to other modules in the text hyperlinks for the HTML and
PDF versions.
parent 766e0cbd
...@@ -7,17 +7,17 @@ ...@@ -7,17 +7,17 @@
\module{anydbm} is a generic interface to variants of the DBM \module{anydbm} is a generic interface to variants of the DBM
database --- \module{dbhash}\refbimodindex{dbhash}, database --- \module{dbhash}\refbimodindex{dbhash},
\module{gdbm}\refbimodindex{gdbm}, or \module{dbm}\refbimodindex{dbm}. \refmodule{gdbm}\refbimodindex{gdbm}, or
If none of these modules is installed, the slow-but-simple \refmodule{dbm}\refbimodindex{dbm}. If none of these modules is
implementation in module \module{dumbdbm}\refstmodindex{dumbdbm} will installed, the slow-but-simple implementation in module
be used. \refmodule{dumbdbm}\refstmodindex{dumbdbm} will be used.
\begin{funcdesc}{open}{filename\optional{, flag\optional{, mode}}} \begin{funcdesc}{open}{filename\optional{, flag\optional{, mode}}}
Open the database file \var{filename} and return a corresponding object. Open the database file \var{filename} and return a corresponding object.
If the database file already exists, the \module{whichdb} module is If the database file already exists, the \refmodule{whichdb} module is
used to determine its type and the appropriate module is used; if it used to determine its type and the appropriate module is used; if it
doesn't exist, the first module listed above that can be imported is does not exist, the first module listed above that can be imported is
used. used.
The optional \var{flag} argument can be The optional \var{flag} argument can be
...@@ -46,6 +46,18 @@ be stored, retrieved, and deleted, and the \method{has_key()} and ...@@ -46,6 +46,18 @@ be stored, retrieved, and deleted, and the \method{has_key()} and
strings. strings.
\begin{seealso}
\seemodule{anydbm}{Generic interface to \code{dbm}-style databases.}
% Should include entry for dbhash, but that isn't documented.
\seemodule{dbm}{Standard \UNIX{} database interface.}
\seemodule{dumbdbm}{Portable implementation of the \code{dbm} interface.}
\seemodule{gdbm}{GNU database interface, based on the \code{dbm} interface.}
\seemodule{shelve}{General object persistence built on top of
the Python \code{dbm} interface.}
\seemodule{whichdb}{Utility module used to determine the type of an
existing database.}
\end{seealso}
\section{\module{dumbdbm} --- \section{\module{dumbdbm} ---
Portable DBM implementation} Portable DBM implementation}
......
\section{\module{shelve} --- \section{\module{shelve} ---
Python object persistency.} Python object persistency}
\declaremodule{standard}{shelve} \declaremodule{standard}{shelve}
\modulesynopsis{Python object persistency.} \modulesynopsis{Python object persistency.}
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
A ``shelf'' is a persistent, dictionary-like object. The difference A ``shelf'' is a persistent, dictionary-like object. The difference
with ``dbm'' databases is that the values (not the keys!) in a shelf with ``dbm'' databases is that the values (not the keys!) in a shelf
can be essentially arbitrary Python objects --- anything that the can be essentially arbitrary Python objects --- anything that the
\code{pickle} module can handle. This includes most class instances, \refmodule{pickle} module can handle. This includes most class
recursive data types, and objects containing lots of shared instances, recursive data types, and objects containing lots of shared
sub-objects. The keys are ordinary strings. sub-objects. The keys are ordinary strings.
\refstmodindex{pickle} \refstmodindex{pickle}
...@@ -32,20 +32,20 @@ list = d.keys() # a list of all existing keys (slow!) ...@@ -32,20 +32,20 @@ list = d.keys() # a list of all existing keys (slow!)
d.close() # close it d.close() # close it
\end{verbatim} \end{verbatim}
%
Restrictions: Restrictions:
\begin{itemize} \begin{itemize}
\item \item
The choice of which database package will be used (e.g. \code{dbm} or The choice of which database package will be used
\code{gdbm}) (e.g. \refmodule{dbm} or \refmodule{gdbm}) depends on which interface
depends on which interface is available. Therefore it isn't safe to is available. Therefore it is not safe to open the database directly
open the database directly using \code{dbm}. The database is also using \refmodule{dbm}. The database is also (unfortunately) subject
(unfortunately) subject to the limitations of \code{dbm}, if it is used --- to the limitations of \refmodule{dbm}, if it is used --- this means
this means that (the pickled representation of) the objects stored in that (the pickled representation of) the objects stored in the
the database should be fairly small, and in rare cases key collisions database should be fairly small, and in rare cases key collisions may
may cause the database to refuse updates. cause the database to refuse updates.
\refbimodindex{dbm} \refbimodindex{dbm}
\refbimodindex{gdbm} \refbimodindex{gdbm}
...@@ -54,7 +54,7 @@ Dependent on the implementation, closing a persistent dictionary may ...@@ -54,7 +54,7 @@ Dependent on the implementation, closing a persistent dictionary may
or may not be necessary to flush changes to disk. or may not be necessary to flush changes to disk.
\item \item
The \code{shelve} module does not support \emph{concurrent} read/write The \module{shelve} module does not support \emph{concurrent} read/write
access to shelved objects. (Multiple simultaneous read accesses are access to shelved objects. (Multiple simultaneous read accesses are
safe.) When a program has a shelf open for writing, no other program safe.) When a program has a shelf open for writing, no other program
should have it open for reading or writing. \UNIX{} file locking can should have it open for reading or writing. \UNIX{} file locking can
...@@ -65,6 +65,11 @@ requires knowledge about the database implementation used. ...@@ -65,6 +65,11 @@ requires knowledge about the database implementation used.
\begin{seealso} \begin{seealso}
\seemodule{anydbm}{Generic interface to \code{dbm}-style databases.}
% Should include entry for dbhash, but that isn't documented.
\seemodule{dbm}{Standard \UNIX{} database interface.}
\seemodule{dumbdbm}{Portable implementation of the \code{dbm} interface.}
\seemodule{gdbm}{GNU database interface, based on the \code{dbm} interface.}
\seemodule{pickle}{Object serialization used by \module{shelve}.} \seemodule{pickle}{Object serialization used by \module{shelve}.}
\seemodule{cPickle}{High-performance version of \module{pickle}.} \seemodule{cPickle}{High-performance version of \module{pickle}.}
\end{seealso} \end{seealso}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment