diff options
author | Raymond Hettinger <python@rcn.com> | 2004-05-30 07:26:47 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-05-30 07:26:47 +0000 |
commit | 691d80532b0a0204e92de35ecba1472d87af6e94 (patch) | |
tree | 25297599e68d9c19c3ea51d145c9a12a60ebc190 /Lib/test/test_set.py | |
parent | d70ad8a9d9c8212af6d83d2d7d08d21760829b17 (diff) | |
download | cpython-git-691d80532b0a0204e92de35ecba1472d87af6e94.tar.gz |
Make sets and deques weak referencable.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r-- | Lib/test/test_set.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 3a85c767a8..514b75c0d6 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -1,5 +1,6 @@ import unittest from test import test_support +from weakref import proxy import operator import copy import pickle @@ -346,6 +347,13 @@ class TestSet(TestJointOps): else: self.assert_(c not in self.s) + def test_weakref(self): + s = self.thetype('gallahad') + p = proxy(s) + self.assertEqual(str(p), str(s)) + s = None + self.assertRaises(ReferenceError, str, p) + class SetSubclass(set): pass |