SF patch #1200018: Restore GC support to set objects
Reverts 1.26 and 1.27.
And adds cycle testing.
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 900d8e4..26e38ab 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -202,6 +202,16 @@
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