Lines Matching refs:cycle
633 self.assertEqual(take(10, cycle('abc')), list('abcabcabca'))
634 self.assertEqual(list(cycle('')), [])
635 self.assertRaises(TypeError, cycle)
636 self.assertRaises(TypeError, cycle, 5)
637 self.assertEqual(list(islice(cycle(gen3()),10)), [0,1,2,0,1,2,0,1,2,0])
641 c = cycle('abc')
656 self.pickletest(proto, cycle('abc'))
661 c = cycle(it)
664 d = pickle.loads(p) # rebuild the cycle object
669 c = cycle(it)
672 d = pickle.loads(p) # rebuild the cycle object
710 # iterator to build a cycle object and then passes in state with
713 c = cycle('defg')
717 # Mode 1 is inefficient. It starts with a cycle object built
719 # cycle and then passes in state with all of the previously
721 c = cycle('defg')
727 cycle('defg').__setstate__([list('abcdefg'), 0])
731 c = cycle('defg')
737 cycle('defg').__setstate__((list('abcdefg'), 'x'))
739 self.assertRaises(TypeError, cycle('').__setstate__, ())
740 self.assertRaises(TypeError, cycle('').__setstate__, ([],))
1594 for f in (chain, cycle, zip, groupby):
1712 self.assertEqual(list(islice(cycle('ABCD'), 12)), list('ABCDABCDABCD'))
1849 self.makecycle(cycle([a]*2), a)
2035 actual = list(islice(cycle(g(s)), tgtlen))
2037 self.assertRaises(TypeError, cycle, X(s))
2038 self.assertRaises(TypeError, cycle, N(s))
2039 self.assertRaises(ZeroDivisionError, list, cycle(E(s)))
2204 # Make sure that chain() and cycle() catch exceptions immediately
2228 self.assertRaises(AssertionError, list, cycle(gen1()))
2278 (cycle, ([1, 2],), [1, 2, 1]),