[docs] Demo code for "dbm" is wrong

Sandro Tosi sandro.tosi at gmail.com
Thu Dec 2 21:53:10 CET 2010


I followed it up on http://bugs.python.org/issue10609

Cheers,
Sandro

On Thu, Dec 2, 2010 at 02:42, Sébastien Frigon <sfrigon at hotmail.com> wrote:
> On this page (about module dbm in Python 3.1):
> http://docs.python.org/py3k/library/dbm.html
>
> In this code sample:
>
> for k, v in db.iteritems():
>
> iteritems is no longer supported in Python 3.1.  This is documented here:
> http://docs.python.org/py3k/whatsnew/3.0.html
>
> "Also, the dict.iterkeys(), dict.iteritems() and
> dict.itervalues() methods are no longer supported."
>
> I suggest to change the following:
>
> Old:
> for k, v in db.iteritems():
>
> New:
> for k, v in db.items():
>
> I'm pretty new to Python so you should double check, but I have tested this
> myself on version 3.1.3.
>
> Regards,
>
> Sébastien
>
>
>
>
>
>
>
> _______________________________________________
> docs mailing list
> docs at python.org
> http://mail.python.org/mailman/listinfo/docs
>
>



-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list