[issue10609] dbm documentation example doesn't work (iteritems())

Dec. 15, 2010
8:28 p.m.
Éric Araujo <merwok@netwok.org> added the comment: IMO, wrapping db in a dict defeats the purpose of dbm implementing a mapping interface. I would use the most natural mapping idioms: - for k, v in db.iteritems(): - print(k, '\t', v) + for k in db: + print(k, '\t', db[k]) The downside of this example is that it does not explicitely call methods, making the comment about “Other dictionary methods” strange. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue10609> _______________________________________
5185
Age (days ago)
5185
Last active (days ago)
0 comments
1 participants
participants (1)
-
Éric Araujo