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

2010-12-28 Thread Georg Brandl
Georg Brandl added the comment: Fixed in r87536. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bu

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

2010-12-17 Thread Georg Brandl
Georg Brandl added the comment: Why not replace it with an example that uses get() or setdefault() then? -- nosy: +georg.brandl ___ Python tracker ___ __

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

2010-12-15 Thread Éric Araujo
Éric Araujo 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 ex

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

2010-12-04 Thread Éric Araujo
Éric Araujo added the comment: Arg, the internal classes returned by dbm.*.open have keys but not necessarily items. See #9523, #6045 and #5736. The docs should be fixed independently of that, with the less non-idiomatic code that we can find. Do you want to check the dbm docs for other sim

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

2010-12-02 Thread Sandro Tosi
Sandro Tosi added the comment: Hi Eric, on and up-to-date py3k I got this: >>> for k, v in db.items(): ... print(k, '\t', v) ... Traceback (most recent call last): File "", line 1, in AttributeError: '_dbm.dbm' object has no attribute 'items' >>> 'items' in dir(db) False (I tried to u

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

2010-12-02 Thread Éric Araujo
Changes by Éric Araujo : -- assignee: -> d...@python components: +Documentation nosy: +d...@python stage: -> needs patch versions: +Python 3.1, Python 3.2 ___ Python tracker __

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

2010-12-02 Thread Éric Araujo
Éric Araujo added the comment: Isn’t s/iteritems/items/ enough? -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mai

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

2010-12-02 Thread Sandro Tosi
New submission from Sandro Tosi : Following http://mail.python.org/pipermail/docs/2010-December/002356.html a possible solution is: diff -r 3b07f7bb0289 Doc/library/dbm.rst --- a/Doc/library/dbm.rst Thu Dec 02 19:29:18 2010 +0100 +++ b/Doc/library/dbm.rst Thu Dec 02 21:51:06 2010 +