Index: Lib/weakref.py =================================================================== --- Lib/weakref.py (révision 73061) +++ Lib/weakref.py (copie de travail) @@ -49,7 +49,7 @@ del self.data[wr.key] self._remove = remove self.data = d = {} - d.update(*args, **kw) + self.update(*args, **kw) def __getitem__(self, key): o = self.data[key]() Index: Lib/test/test_weakref.py =================================================================== --- Lib/test/test_weakref.py (révision 73061) +++ Lib/test/test_weakref.py (copie de travail) @@ -942,6 +942,17 @@ dict[o] = o.arg return dict, objects + def test_make_weak_valued_dict_from_dict(self): + o = Object(3) + dict = weakref.WeakValueDictionary({364:o}) + self.assertEqual(dict[364], o) + + def test_make_weak_valued_dict_from_weak_valued_dict(self): + o = Object(3) + dict = weakref.WeakValueDictionary({364:o}) + dict2 = weakref.WeakValueDictionary(dict) + self.assertEqual(dict[364], o) + def make_weak_valued_dict(self): dict = weakref.WeakValueDictionary() objects = list(map(Object, range(self.COUNT)))