mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
SF patch #1200018: Restore GC support to set objects
Reverts 1.26 and 1.27. And adds cycle testing.
This commit is contained in:
parent
f33f5e9d6e
commit
bb999b5925
2 changed files with 34 additions and 7 deletions
|
|
@ -202,6 +202,16 @@ class TestJointOps(unittest.TestCase):
|
|||
self.assertNotEqual(id(t), id(newt))
|
||||
self.assertEqual(t.value + 1, newt.value)
|
||||
|
||||
def test_gc(self):
|
||||
# Create a nest of cycles to exercise overall ref count check
|
||||
class A:
|
||||
pass
|
||||
s = set(A() for i in xrange(1000))
|
||||
for elem in s:
|
||||
elem.cycle = s
|
||||
elem.sub = elem
|
||||
elem.set = set([elem])
|
||||
|
||||
class TestSet(TestJointOps):
|
||||
thetype = set
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue