Add GC support to count() objects.

This commit is contained in:
Raymond Hettinger 2009-02-16 20:50:56 +00:00
parent d67c60ff81
commit d6280f4b78
2 changed files with 19 additions and 4 deletions

View file

@ -979,6 +979,11 @@ class TestGC(unittest.TestCase):
a = []
self.makecycle(compress('ABCDEF', [1,0,1,0,1,0]), a)
def test_count(self):
a = []
Int = type('Int', (int,), dict(x=a))
self.makecycle(count(Int(0), Int(1)), a)
def test_cycle(self):
a = []
self.makecycle(cycle([a]*2), a)