diff options
author | Raymond Hettinger <python@rcn.com> | 2004-05-30 07:26:47 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-05-30 07:26:47 (GMT) |
commit | 691d80532b0a0204e92de35ecba1472d87af6e94 (patch) | |
tree | 25297599e68d9c19c3ea51d145c9a12a60ebc190 /Lib/test/test_deque.py | |
parent | d70ad8a9d9c8212af6d83d2d7d08d21760829b17 (diff) | |
download | cpython-691d80532b0a0204e92de35ecba1472d87af6e94.zip cpython-691d80532b0a0204e92de35ecba1472d87af6e94.tar.gz cpython-691d80532b0a0204e92de35ecba1472d87af6e94.tar.bz2 |
Make sets and deques weak referencable.
Diffstat (limited to 'Lib/test/test_deque.py')
-rw-r--r-- | Lib/test/test_deque.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_deque.py b/Lib/test/test_deque.py index bad8857..13800ea 100644 --- a/Lib/test/test_deque.py +++ b/Lib/test/test_deque.py @@ -1,6 +1,7 @@ from collections import deque import unittest from test import test_support +from weakref import proxy import copy import cPickle as pickle from cStringIO import StringIO @@ -435,6 +436,12 @@ class TestSubclass(unittest.TestCase): self.assertEqual(type(d), type(e)) self.assertEqual(list(d), list(e)) + def test_weakref(self): + d = deque('gallahad') + p = proxy(d) + self.assertEqual(str(p), str(d)) + d = None + self.assertRaises(ReferenceError, str, p) #============================================================================== |