From b9da9bc0a04b718e8395e2e88c3053ab944579b7 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 4 Feb 2008 20:44:31 +0000 Subject: Start replacing UserDict.DictMixin with collections.MutableMapping (the bsddb modules are next). --- Lib/shelve.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Lib/shelve.py') diff --git a/Lib/shelve.py b/Lib/shelve.py index 586d2535d8..67878db45f 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) -- cgit v1.2.1