diff options
author | Raymond Hettinger <python@rcn.com> | 2008-02-04 21:26:27 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-02-04 21:26:27 +0000 |
commit | d190f9c45e07caa77f8f79ac34560d41271a7c7b (patch) | |
tree | 7e2e70f6bcd043ed856d11739fba7de15b9fdfb8 /Lib/bsddb/dbobj.py | |
parent | 3be449ae36cc0a11646dd8f6708e2cebddbe44bf (diff) | |
download | cpython-git-d190f9c45e07caa77f8f79ac34560d41271a7c7b.tar.gz |
In bsddb, replace UserDict.DictMixin with collections.MutableMapping.
I can't test this directly on my build, so letting the buildbots do it for me.
If it fails, expect a reversion.
Diffstat (limited to 'Lib/bsddb/dbobj.py')
-rw-r--r-- | Lib/bsddb/dbobj.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/bsddb/dbobj.py b/Lib/bsddb/dbobj.py index 987f7735f5..4c0f12582d 100644 --- a/Lib/bsddb/dbobj.py +++ b/Lib/bsddb/dbobj.py @@ -24,10 +24,9 @@ from . import db try: - from UserDict import DictMixin + from collections import MutableMapping except ImportError: - # DictMixin is new in Python 2.3 - class DictMixin: pass + class MutableMapping: pass class DBEnv: def __init__(self, *args, **kwargs): @@ -113,7 +112,7 @@ class DBEnv: return self._cobj.lsn_reset(*args, **kwargs) -class DB(DictMixin): +class DB(MutableMapping): def __init__(self, dbenv, *args, **kwargs): # give it the proper DBEnv C object that its expecting self._cobj = db.DB(dbenv._cobj, *args, **kwargs) @@ -127,6 +126,8 @@ class DB(DictMixin): self._cobj[key] = value def __delitem__(self, arg): del self._cobj[arg] + def __iter__(self): + return iter(self.keys()) def append(self, *args, **kwargs): return self._cobj.append(*args, **kwargs) |