[issue10609] dbm documentation example doesn't work (iteritems())
Dec. 16, 2010
1:28 a.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> _______________________________________
5809
Age (days ago)
5809
Last active (days ago)
0 comments
1 participants
participants (1)
-
Éric Araujo