コード例 #1
0
def test_ex_sct_copy_pos(addx):
    assert EagerChain(ChainedCall(addx, ("x", )),
                      state="state")._state == "statex"
コード例 #2
0
def test_ex_sct_copy_kw(addx):
    assert (EagerChain(ChainedCall(addx, kwargs={"x": "x"}),
                       state="state")._state == "statex")
コード例 #3
0
def test_f_sct_copy_pos(addx):
    assert LazyChain(ChainedCall(addx, ("x", )))("state") == "statex"
コード例 #4
0
def test_f_sct_copy_kw(addx):
    assert LazyChain(ChainedCall(addx, kwargs={"x": "x"}))("state") == "statex"
コード例 #5
0
def f2():
    return LazyChain(ChainedCall(lambda state, c: state + c, kwargs={"c":
                                                                     "c"}))
コード例 #6
0
def f():
    return LazyChain(ChainedCall(lambda state, b: state + b, kwargs={"b":
                                                                     "b"}))