diff options
author | Raymond Hettinger <python@rcn.com> | 2003-09-12 06:33:37 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-09-12 06:33:37 (GMT) |
commit | deadbf50e4cc3c541e706d5bf1aa73624bed36a6 (patch) | |
tree | 407b9e5f2aa93866cdda5fb5b70fee3d49d2de0e /Doc/lib/libbsddb.tex | |
parent | 74c8e55f3b64b8819a1950be4ac1323c74931cc2 (diff) | |
download | cpython-deadbf50e4cc3c541e706d5bf1aa73624bed36a6.zip cpython-deadbf50e4cc3c541e706d5bf1aa73624bed36a6.tar.gz cpython-deadbf50e4cc3c541e706d5bf1aa73624bed36a6.tar.bz2 |
SF #662923
Add support for the iterator and mapping protocols.
For Py2.3, this was done for shelve, dumbdbm and other mapping objects, but
not for bsddb and dbhash which were inadvertently missed.
Diffstat (limited to 'Doc/lib/libbsddb.tex')
-rw-r--r-- | Doc/lib/libbsddb.tex | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Doc/lib/libbsddb.tex b/Doc/lib/libbsddb.tex index 7fb8f76..719783b 100644 --- a/Doc/lib/libbsddb.tex +++ b/Doc/lib/libbsddb.tex @@ -100,8 +100,9 @@ systems which ship with the old Berkeley DB 1.85 database library. The \subsection{Hash, BTree and Record Objects \label{bsddb-objects}} -Once instantiated, hash, btree and record objects support the following -methods: +Once instantiated, hash, btree and record objects support +the same methods as dictionaries. In addition, they support +the following methods: \begin{methoddesc}{close}{} Close the underlying file. The object can no longer be accessed. Since @@ -177,6 +178,20 @@ Example: ('2', '4') >>> db.previous() ('1', '1') +>>> for k, v in db.iteritems(): +... print k, v +0 0 +1 1 +2 4 +3 9 +4 16 +5 25 +6 36 +7 49 +8 64 +9 81 +>>> 8 in db +True >>> db.sync() 0 \end{verbatim} |