Lines Matching refs:isEven
29 def isEven(x): function
541 self.assertEqual(list(ifilter(isEven, range(6))), [0,2,4])
544 self.assertEqual(take(4, ifilter(isEven, count())), [0,2,4,6])
548 self.assertRaises(TypeError, ifilter, isEven, 3)
552 self.assertEqual(list(ifilterfalse(isEven, range(6))), [1,3,5])
555 self.assertEqual(take(4, ifilterfalse(isEven, count())), [1,3,5,7])
559 self.assertRaises(TypeError, ifilterfalse, isEven, 3)
1356 self.assertEqual(list(ifilter(isEven, g(s))), filter(isEven, g(s)))
1357 self.assertRaises(TypeError, ifilter, isEven, X(s))
1358 self.assertRaises(TypeError, list, ifilter(isEven, N(s)))
1359 self.assertRaises(ZeroDivisionError, list, ifilter(isEven, E(s)))
1364 self.assertEqual(list(ifilterfalse(isEven, g(s))), filter(isOdd, g(s)))
1365 self.assertRaises(TypeError, ifilterfalse, isEven, X(s))
1366 self.assertRaises(TypeError, list, ifilterfalse(isEven, N(s)))
1367 self.assertRaises(ZeroDivisionError, list, ifilterfalse(isEven, E(s)))
1418 if not isEven(elem): break
1420 self.assertEqual(list(takewhile(isEven, g(s))), tgt)
1421 self.assertRaises(TypeError, takewhile, isEven, X(s))
1422 self.assertRaises(TypeError, list, takewhile(isEven, N(s)))
1423 self.assertRaises(ZeroDivisionError, list, takewhile(isEven, E(s)))