[Python-bugs-list] [ python-Feature Requests-662923 ] iterator for dbm keys

SourceForge.net noreply@sourceforge.net
Sat, 08 Feb 2003 02:27:58 -0800


Feature Requests item #662923, was opened at 2003-01-06 02:34
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=662923&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: paul rubin (phr)
Assigned to: Nobody/Anonymous (nobody)
Summary: iterator for dbm keys

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: paul rubin (phr)
Date: 2003-02-08 10:27

Message:
Logged In: YES 
user_id=72053

That's nice about shelve, but really, all the dbm classes
need this operation.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2003-01-10 09:47

Message:
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().

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=662923&group_id=5470