예제 #1
0
def test_remove():
    r = remove(iseven, range(5))
    assert type(r) is not list
    assert list(r) == list(filter(isodd, range(5)))
def test_map_filter_are_lazy():
    def bad(x):
        raise Exception()

    map(bad, [1, 2, 3])
    filter(bad, [1, 2, 3])
예제 #3
0
def test_remove():
    r = remove(iseven, range(5))
    assert type(r) is not list
    assert list(r) == list(filter(isodd, range(5)))
예제 #4
0
def test_map_filter_are_lazy():
    def bad(x):
        raise Exception()
    map(bad, [1, 2, 3])
    filter(bad, [1, 2, 3])