summaryrefslogtreecommitdiffstats
path: root/Lib/shelve.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-04 20:44:31 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-02-04 20:44:31 (GMT)
commitb9da9bc0a04b718e8395e2e88c3053ab944579b7 (patch)
tree39e44e2cc664befbe4ede987ad71ea37db3bb7b0 /Lib/shelve.py
parent15ebc88d87d2ff8f520581a9f6a6816d78a7e504 (diff)
downloadcpython-b9da9bc0a04b718e8395e2e88c3053ab944579b7.zip
cpython-b9da9bc0a04b718e8395e2e88c3053ab944579b7.tar.gz
cpython-b9da9bc0a04b718e8395e2e88c3053ab944579b7.tar.bz2
Start replacing UserDict.DictMixin with collections.MutableMapping (the bsddb modules are next).
Diffstat (limited to 'Lib/shelve.py')
-rw-r--r--Lib/shelve.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/shelve.py b/Lib/shelve.py
index 586d253..67878db 100644
--- a/Lib/shelve.py
+++ b/Lib/shelve.py
@@ -59,12 +59,12 @@ the persistent dictionary on disk, if feasible).
from pickle import Pickler, Unpickler
from io import BytesIO
-import UserDict
+import collections
import warnings
__all__ = ["Shelf","BsdDbShelf","DbfilenameShelf","open"]
-class Shelf(UserDict.DictMixin):
+class Shelf(collections.MutableMapping):
"""Base class for shelf implementations.
This is initialized with a dictionary-like object.
@@ -81,7 +81,7 @@ class Shelf(UserDict.DictMixin):
self.cache = {}
self.keyencoding = "utf-8"
- def keys(self):
+ def __iter__(self):
for k in self.dict.keys():
yield k.decode(self.keyencoding)