[Python-checkins] python/dist/src/Lib/bsddb __init__.py, 1.5, 1.5.10.1

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Tue Sep 16 17:42:15 EDT 2003


Update of /cvsroot/python/python/dist/src/Lib/bsddb
In directory sc8-pr-cvs1:/tmp/cvs-serv1770/Lib/bsddb
Modified Files:
 Tag: release23-maint
	__init__.py 
Log Message:
Fix documentation bugs.
Add support for iterators and other mapping methods.
Convert tests to unittest format and expand their coverage.
Index: __init__.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v
retrieving revision 1.5
retrieving revision 1.5.10.1
diff -C2 -d -r1.5 -r1.5.10.1
*** __init__.py	24 Apr 2003 16:02:44 -0000	1.5
--- __init__.py	16 Sep 2003 21:42:13 -0000	1.5.10.1
***************
*** 53,58 ****
 #----------------------------------------------------------------------
 
 
! class _DBWithCursor:
 """
 A simple wrapper around DB that makes it look like the bsddbobject in
--- 53,59 ----
 #----------------------------------------------------------------------
 
+ import UserDict
 
! class _DBWithCursor(UserDict.DictMixin):
 """
 A simple wrapper around DB that makes it look like the bsddbobject in
***************
*** 145,148 ****
--- 146,166 ----
 return self.db.sync()
 
+ def __iter__(self):
+ try:
+ yield self.first()[0]
+ next = self.next
+ while 1:
+ yield next()[0]
+ except _bsddb.DBNotFoundError:
+ return
+ 
+ def iteritems(self):
+ try:
+ yield self.first()
+ next = self.next
+ while 1:
+ yield next()
+ except _bsddb.DBNotFoundError:
+ return
 
 #----------------------------------------------------------------------


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /