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

Skip to content

Commit 2aefe8d

Browse files
committed
Document changed semantics -- open() now guesses the db type and error
is now a tuple of various and sundry exceptions.
1 parent fc1f64d commit 2aefe8d

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

Doc/lib/libanydbm.tex

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ \section{Standard Module \module{anydbm}}
1111

1212
\begin{funcdesc}{open}{filename\optional{, flag\optional{, mode}}}
1313
Open the database file \var{filename} and return a corresponding object.
14+
15+
If the database file already exists, the \module{whichdb} module is
16+
used to determine its type and the appropriate module is used; if it
17+
doesn't exist, the first module listed above that can be imported is
18+
used.
19+
1420
The optional \var{flag} argument can be
1521
\code{'r'} to open an existing database for reading only,
1622
\code{'w'} to open an existing database for reading and writing,
@@ -24,8 +30,10 @@ \section{Standard Module \module{anydbm}}
2430
\end{funcdesc}
2531

2632
\begin{excdesc}{error}
27-
An alternate name for the \exception{error} exception defined by the
28-
underlying database implementation.
33+
A tuple containing the exceptions that can be raised by each of the
34+
supported modules, with a unique exception \exception{anydbm.error} as
35+
the first item --- the latter is used when \exception{anydbm.error} is
36+
raised.
2937
\end{excdesc}
3038

3139
The object returned by \function{open()} supports most of the same

Doc/libanydbm.tex

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ \section{Standard Module \module{anydbm}}
1111

1212
\begin{funcdesc}{open}{filename\optional{, flag\optional{, mode}}}
1313
Open the database file \var{filename} and return a corresponding object.
14+
15+
If the database file already exists, the \module{whichdb} module is
16+
used to determine its type and the appropriate module is used; if it
17+
doesn't exist, the first module listed above that can be imported is
18+
used.
19+
1420
The optional \var{flag} argument can be
1521
\code{'r'} to open an existing database for reading only,
1622
\code{'w'} to open an existing database for reading and writing,
@@ -24,8 +30,10 @@ \section{Standard Module \module{anydbm}}
2430
\end{funcdesc}
2531

2632
\begin{excdesc}{error}
27-
An alternate name for the \exception{error} exception defined by the
28-
underlying database implementation.
33+
A tuple containing the exceptions that can be raised by each of the
34+
supported modules, with a unique exception \exception{anydbm.error} as
35+
the first item --- the latter is used when \exception{anydbm.error} is
36+
raised.
2937
\end{excdesc}
3038

3139
The object returned by \function{open()} supports most of the same

0 commit comments

Comments
 (0)