def test_itertools_filterfalse(self):
"""
Tests whether itertools.filterfalse is available.
"""
from itertools import filterfalse
not_div_by_3 = filterfalse(lambda x: x % 3 == 0, range(8))
self.assertEqual(list(not_div_by_3), [1, 2, 4, 5, 7])
评论列表
文章目录