[New-bugs-announce] [issue5736] Add the iterator protocol to dbm modules

Akira Kitada report at bugs.python.org
Sat Apr 11 15:47:53 CEST 2009

New submission from Akira Kitada <akitada at gmail.com>:

In Python 2.6, dbm modules othar than bsddb don't support the iterator

>>> import dbm
>>> d = dbm.open('spam.dbm', 'c')
>>> for k in range(5): d["key%d" % k] = "value%d" % k
>>> for k in d: print k, d[k]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'dbm.dbm' object is not iterable

Adding iterator support would make dbm modules more convenient and
easier to use.

components: Extension Modules
messages: 85856
nosy: akitada
severity: normal
status: open
title: Add the iterator protocol to dbm modules
type: feature request
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list