Lines Matching refs:isEven
34 def isEven(x): function
837 self.assertEqual(list(filter(isEven, range(6))), [0,2,4])
840 self.assertEqual(take(4, filter(isEven, count())), [0,2,4,6])
844 self.assertRaises(TypeError, filter, isEven, 3)
850 c = filter(isEven, range(6))
852 c = filter(isEven, range(6))
855 c = filter(isEven, range(6))
860 c = filter(isEven, range(6))
864 self.assertEqual(list(filterfalse(isEven, range(6))), [1,3,5])
867 self.assertEqual(take(4, filterfalse(isEven, count())), [1,3,5,7])
871 self.assertRaises(TypeError, filterfalse, isEven, 3)
874 self.pickletest(proto, filterfalse(isEven, range(6)))
1946 self.assertEqual(list(filter(isEven, g(s))),
1947 [x for x in g(s) if isEven(x)])
1948 self.assertRaises(TypeError, filter, isEven, X(s))
1949 self.assertRaises(TypeError, filter, isEven, N(s))
1950 self.assertRaises(ZeroDivisionError, list, filter(isEven, E(s)))
1955 self.assertEqual(list(filterfalse(isEven, g(s))),
1957 self.assertRaises(TypeError, filterfalse, isEven, X(s))
1958 self.assertRaises(TypeError, filterfalse, isEven, N(s))
1959 self.assertRaises(ZeroDivisionError, list, filterfalse(isEven, E(s)))
2013 if not isEven(elem): break
2015 self.assertEqual(list(takewhile(isEven, g(s))), tgt)
2016 self.assertRaises(TypeError, takewhile, isEven, X(s))
2017 self.assertRaises(TypeError, takewhile, isEven, N(s))
2018 self.assertRaises(ZeroDivisionError, list, takewhile(isEven, E(s)))