diff options
author | Collin Winter <collinw@gmail.com> | 2007-09-01 23:34:30 (GMT) |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-09-01 23:34:30 (GMT) |
commit | c79461b1648c9209c3652184572a17eef0a76202 (patch) | |
tree | 47c6238c8c47c4881f6f0523ea86d201cea1fc94 /Doc/library/bsddb.rst | |
parent | 2ac012130549b1ef51ebce11148d01eaca1a7033 (diff) | |
download | cpython-c79461b1648c9209c3652184572a17eef0a76202.zip cpython-c79461b1648c9209c3652184572a17eef0a76202.tar.gz cpython-c79461b1648c9209c3652184572a17eef0a76202.tar.bz2 |
Partial py3k-ification of Doc/library/: convert has_key references into either 'k in d' or __contains__; normalize raise statements; convert print statements into print function calls.
Diffstat (limited to 'Doc/library/bsddb.rst')
-rw-r--r-- | Doc/library/bsddb.rst | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Doc/library/bsddb.rst b/Doc/library/bsddb.rst index c5c6276..aff1d5b 100644 --- a/Doc/library/bsddb.rst +++ b/Doc/library/bsddb.rst @@ -105,6 +105,11 @@ Once instantiated, hash, btree and record objects support the same methods as dictionaries. In addition, they support the methods listed below. +.. describe:: key in bsddbobject + + Return ``True`` if the DB file contains the argument as a key. + + .. method:: bsddbobject.close() Close the underlying file. The object can no longer be accessed. Since there @@ -119,11 +124,6 @@ dictionaries. In addition, they support the methods listed below. returned is different for different file formats. -.. method:: bsddbobject.has_key(key) - - Return ``1`` if the DB file contains the argument as a key. - - .. method:: bsddbobject.set_location(key) Set the cursor to the item indicated by *key* and return a tuple containing the @@ -169,7 +169,8 @@ Example:: >>> import bsddb >>> db = bsddb.btopen('/tmp/spam.db', 'c') - >>> for i in range(10): db['%d'%i] = '%d'% (i*i) + >>> for i in range(10): + ... db[str(i)] = '%d' % (i*i) ... >>> db['3'] '9' @@ -186,7 +187,7 @@ Example:: >>> db.previous() ('1', '1') >>> for k, v in db.iteritems(): - ... print k, v + ... print(k, v) 0 0 1 1 2 4 |