Пример #1
0
def test_chain_iterable_inputs():
    f = lambda x: (x, x + 2)
    g = lambda L: sum(L)
    h = chain(f, g)
    k = chain(f, sum)
    assert h(2) == 6
    assert k(2) == 6
Пример #2
0
def test_chain_iterable_inputs():
    f = lambda x : (x, x+2)
    g = lambda L : sum(L)
    h = chain(f, g)
    k = chain(f, sum)
    assert h(2) == 6
    assert k(2) == 6
Пример #3
0
def test_chain():
    f = lambda x: x**2
    g = lambda x: (x, x + 2)
    h = lambda x, y: (x + y)
    k = chain(g, h, f)
    assert k(2) == 36
Пример #4
0
def test_chain():
    f = lambda x: x**2
    g = lambda x: (x, x+2)
    h = lambda x,y: (x+y)
    k = chain(g, h, f)
    assert k(2) == 36