[Python-bugs-list] [ python-Feature Requests-662923 ] iterator for dbm keys
SourceForge.net
noreply@sourceforge.net
Fri, 10 Jan 2003 01:47:34 -0800
Feature Requests item #662923, was opened at 2003-01-05 21: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: Raymond Hettinger (rhettinger)
Date: 2003-01-10 04: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