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

Skip to content

Commit e1d4715

Browse files
committed
Update explanation of the set_location() method to indicate that in
BTree databases, the key need not be in the database. Also, tell about the exception if the key is not in the DB for other DB types. This closes SF bug #127377.
1 parent a4d18a0 commit e1d4715

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Doc/lib/libbsddb.tex

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ \subsection{Hash, BTree and Record Objects \label{bsddb-objects}}
103103
\end{methoddesc}
104104

105105
\begin{methoddesc}{set_location}{key}
106-
Set the cursor to the item indicated by the key and return it.
106+
Set the cursor to the item indicated by \var{key} and return a tuple
107+
containing the key and its value. For binary tree databases (opened
108+
using \function{btopen()}), if \var{key} does not actually exist in
109+
the database, the cursor will point to the next item in sorted order
110+
and return that key and value. For other databases,
111+
\exception{KeyError} will be raised if \var{key} is not found in the
112+
database.
107113
\end{methoddesc}
108114

109115
\begin{methoddesc}{first}{}

0 commit comments

Comments
 (0)