[Raymond] > > I would like to backport this patch to Py2.3.1. > > The effort to provide a full mapping interface to all > > mapping like objects was attempted in Py2.3 and several > > modules for the bsddb package were updated, but this > > one was missed and the package was left half converted. > > > > IIRC, dbhash and bsddb don't affect the Apple MacIntosh > > users. Also, since this effort was started for bsddb and > > only half completed, I view it to be a bit of a bugfix as > > well as being featurelike. It certainly affects the usability > > of the module (the looping example and related text in > > the docs were both wrong -- that would not have happened > > if the normal looping expectations were supported). [GvR] > Can you discuss this on python-dev? Guys, are you okay with backporting this? Raymond Hettinger Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** __init__.py 24 Apr 2003 16:02:44 -0000 1.5 --- __init__.py 12 Sep 2003 06:33:37 -0000 1.6 *************** *** 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,157 ---- return self.db.sync() + def __iter__(self): + try: + yield self.first()[0] + next = self.next + while 1: + yield next()[0] + except _bsddb.DBNotFoundError: + return #----------------------------------------------------------------------
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4