[Python-checkins] python/dist/src/Lib/bsddb __init__.py,1.6,1.7
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Sep 12 23:18:36 EDT 2003
Update of /cvsroot/python/python/dist/src/Lib/bsddb
In directory sc8-pr-cvs1:/tmp/cvs-serv23415
Modified Files:
__init__.py
Log Message:
The previous change works much faster (one lookup per key) when
iteritems() is defined.
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** __init__.py 12 Sep 2003 06:33:37 -0000 1.6
--- __init__.py 13 Sep 2003 03:18:34 -0000 1.7
***************
*** 155,158 ****
--- 155,167 ----
return
+ def iteritems(self):
+ try:
+ yield self.first()
+ next = self.next
+ while 1:
+ yield next()
+ except _bsddb.DBNotFoundError:
+ return
+
#----------------------------------------------------------------------
# Compatibility object factory functions
More information about the Python-checkins
mailing list