Exemple #1
0
def test_should_throw():
    try:
        (let()
            | ('x', expr('x'))
            | ('y', expr('y'))
         ).in_("hogee")
    except TypeError:
        assert True
    else:
        assert False
Exemple #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'