Lines Matching refs:isEven
29 def isEven(x):
502 self.assertEqual(list(ifilter(isEven, range(6))), [0,2,4])
505 self.assertEqual(take(4, ifilter(isEven, count())), [0,2,4,6])
509 self.assertRaises(TypeError, ifilter, isEven, 3)
513 self.assertEqual(list(ifilterfalse(isEven, range(6))), [1,3,5])
516 self.assertEqual(take(4, ifilterfalse(isEven, count())), [1,3,5,7])
520 self.assertRaises(TypeError, ifilterfalse, isEven, 3)
1242 self.assertEqual(list(ifilter(isEven, g(s))), filter(isEven, g(s)))
1243 self.assertRaises(TypeError, ifilter, isEven, X(s))
1244 self.assertRaises(TypeError, list, ifilter(isEven, N(s)))
1245 self.assertRaises(ZeroDivisionError, list, ifilter(isEven, E(s)))
1250 self.assertEqual(list(ifilterfalse(isEven, g(s))), filter(isOdd, g(s)))
1251 self.assertRaises(TypeError, ifilterfalse, isEven, X(s))
1252 self.assertRaises(TypeError, list, ifilterfalse(isEven, N(s)))
1253 self.assertRaises(ZeroDivisionError, list, ifilterfalse(isEven, E(s)))
1304 if not isEven(elem): break
1306 self.assertEqual(list(takewhile(isEven, g(s))), tgt)
1307 self.assertRaises(TypeError, takewhile, isEven, X(s))
1308 self.assertRaises(TypeError, list, takewhile(isEven, N(s)))
1309 self.assertRaises(ZeroDivisionError, list, takewhile(isEven, E(s)))