This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: iterator for dbm keys
Type: enhancement Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: phr, rhettinger
Priority: normal Keywords:

Created on 2003-01-06 02:34 by phr, last changed 2022-04-10 16:06 by admin. This issue is now closed.

Messages (5)
msg53720 - (view) Author: paul rubin (phr) Date: 2003-01-06 02:34
if d is a dbm (gdbm, bsddb, shelve, etc.) object, then
"for k in d"
should iterate through the keys of d, like you can do
with dicts.  Alternatively, add a new operation,
d.xkeys(), which returns an iterator that steps through
all the keys in d.  d.keys() is often inappropriate
since dbm databases can be extremely large and d.keys()
tries to read all the keys into memory at once.
msg53721 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-01-10 09:47
Logged In: YES 
user_id=80475

* for Py2.3, all shelve now inherits from UserDict.DictMixin 
which adds in the missing methods for a dictionary style 
interface.

* the appropriate name for d.xkeys() is d.iterkeys().
msg53722 - (view) Author: paul rubin (phr) Date: 2003-02-08 10:27
Logged In: YES 
user_id=72053

That's nice about shelve, but really, all the dbm classes
need this operation.
msg53723 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-05-12 18:08
Logged In: YES 
user_id=80475

I think this was taken case of for Python 2.3.  Please 
check to see if all of your needs have been met.  If so, 
please close the request.  If not, paste a patch (applying 
UserDict.DictMixin) for anything that was missed.
msg53724 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2003-09-12 06:36
Logged In: YES 
user_id=80475

bsddb and dbhash were missed for Py2.3.
Adding the to Py2.4.
See:
   Lib/bsddb/__init__.py 1.6
   Lib/test/test_bsddb.py 1.13
History
Date User Action Args
2022-04-10 16:06:06adminsetgithub: 37726
2003-01-06 02:34:29phrcreate