summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_shelve.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-02-04 22:07:15 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-02-04 22:07:15 (GMT)
commitedf3b734c05b754f03e36c1eb69bfc7343b8a150 (patch)
tree1bbfa338b8b264a123476aa5a8a454367dd013b7 /Lib/test/test_shelve.py
parentd190f9c45e07caa77f8f79ac34560d41271a7c7b (diff)
downloadcpython-edf3b734c05b754f03e36c1eb69bfc7343b8a150.zip
cpython-edf3b734c05b754f03e36c1eb69bfc7343b8a150.tar.gz
cpython-edf3b734c05b754f03e36c1eb69bfc7343b8a150.tar.bz2
Remove DictMixin which is superceded by collections.MutableMapping
Diffstat (limited to 'Lib/test/test_shelve.py')
-rw-r--r--Lib/test/test_shelve.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_shelve.py b/Lib/test/test_shelve.py
index e5d19f5..6d917ff 100644
--- a/Lib/test/test_shelve.py
+++ b/Lib/test/test_shelve.py
@@ -2,13 +2,13 @@ import unittest
import shelve
import glob
from test import test_support
-from UserDict import DictMixin
+from collections import MutableMapping
from test.test_anydbm import dbm_iterator
def L1(s):
return s.decode("latin-1")
-class byteskeydict(DictMixin):
+class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
@@ -23,10 +23,15 @@ class byteskeydict(DictMixin):
def __delitem__(self, key):
del self.d[L1(key)]
+ def __len__(self):
+ return len(self.d)
+
def iterkeys(self):
for k in self.d.keys():
yield k.encode("latin-1")
+ __iter__ = iterkeys
+
def keys(self):
return list(self.iterkeys())