示例#1
0
def test_list_mult_speed():
    config = DraconicConfig(max_loops=10000, max_const_len=10000)
    i = DraconicInterpreter(config=config)
    expr = """
    while True:
        a = [0] * 10000
    """.strip()
    with pytest.raises(TooManyStatements):
        i.execute(expr)
示例#2
0
def i():
    config = DraconicConfig()
    inter = DraconicInterpreter(config=config)

    inter.out__ = []

    def foo(v):
        inter.out__.append(v)

    inter.builtins['print'] = foo
    inter.builtins['range'] = range
    return inter
示例#3
0
def i():
    # 1000-size iterables, don't limit us by loops, signed 32b int limit
    config = DraconicConfig(max_loops=99999999,
                            max_const_len=1000,
                            max_int_size=32)
    return DraconicInterpreter(config=config)