Use the WeakKeyDictionary and WeakValueDictionary classes directly

instead of using the mapping() function.
This commit is contained in:
Fred Drake 2001-04-10 19:09:35 +00:00
parent f6cdead8e9
commit bf43691ccb
1 changed files with 2 additions and 2 deletions

View File

@ -210,7 +210,7 @@ class MappingTestCase(TestBase):
COUNT = 10
def test_weak_values(self):
dict = weakref.mapping()
dict = weakref.WeakValueDictionary()
objects = map(Object, range(self.COUNT))
for o in objects:
dict[o.arg] = o
@ -236,7 +236,7 @@ class MappingTestCase(TestBase):
"deleting the values did not clear the dictionary")
def test_weak_keys(self):
dict = weakref.mapping(weakkeys=1)
dict = weakref.WeakKeyDictionary()
objects = map(Object, range(self.COUNT))
for o in objects:
dict[o] = o.arg