示例#1
0
 def test_itemfilter(self):
     D, kw = self.D, self.kw
     assert itemfilter(lambda item: iseven(item[0]), D({
         1: 2,
         2: 3
     }), **kw) == D({2: 3})
     assert itemfilter(lambda item: iseven(item[1]), D({
         1: 2,
         2: 3
     }), **kw) == D({1: 2})
示例#2
0
 def test_itemfilter(self):
     D, kw = self.D, self.kw
     assert itemfilter(lambda item: iseven(item[0]), D({1: 2, 2: 3}), **kw) == D({2: 3})
     assert itemfilter(lambda item: iseven(item[1]), D({1: 2, 2: 3}), **kw) == D({1: 2})
def test_itemfilter():
    assert itemfilter(lambda item: iseven(item[0]), {1: 2, 2: 3}) == {2: 3}
    assert itemfilter(lambda item: iseven(item[1]), {1: 2, 2: 3}) == {1: 2}