Outdated documentation

L

Laszlo Zsolt Nagy

Hi All,


This is from the documentation of the dbhash module:

Returns the key next key/value pair in a database traversal. The
following code prints every key in the database |db|, without having
to create a list in memory that contains them all:

print db.first()
for i in xrange(1, len(db)):
print db.next()


Apparently, it is different for gdbm:

k = db.firstkey()
while k != None:
print k
k = db.nextkey(k)

I think both of them is outdated. This should be:

for key,value in db.iteritems():
print key,value

Is this the good place to post?

Les
 
K

Kent Johnson

Laszlo said:
Is this the good place to post?

Follow the "About this document" link at the bottom of any page of Python docs for information about submitting change requests.

Kent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top