Exemplo n.º 1
0
def test_should_throw():
    try:
        (let()
            | ('x', expr('x'))
            | ('y', expr('y'))
         ).in_("hogee")
    except TypeError:
        assert True
    else:
        assert False
Exemplo n.º 2
0
def test_with_block():
    let_ = (let()
        | ('x', expr('x'))
        | ('y', expr('y'))
    )
    @let_.in_()
    def _(x, y):
        return x + y

    assert let_.end == 'xy'