Esempio n. 1
0
def test_one():
    def f():
        pass
    assert can_inline(0, f.func_code)
    def f():
        while i < 0:
            pass
    assert not can_inline(0, f.func_code)
    def f(a, b):
        return a + b
    assert can_inline(0, f.func_code)
Esempio n. 2
0
def test_one():
    space = FakeSpace()
    def f():
        pass
    code = pycode.PyCode._from_code(space, f.func_code)
    assert can_inline(0, code)
    def f():
        while i < 0:
            pass
    code = pycode.PyCode._from_code(space, f.func_code)
    assert not can_inline(0, code)
    def f(a, b):
        return a + b
    code = pycode.PyCode._from_code(space, f.func_code)
    assert can_inline(0, code)
Esempio n. 3
0
def test_one():
    space = FakeSpace()

    def f():
        pass

    code = pycode.PyCode._from_code(space, f.func_code)
    assert can_inline(0, code)

    def f():
        while i < 0:
            pass

    code = pycode.PyCode._from_code(space, f.func_code)
    assert not can_inline(0, code)

    def f(a, b):
        return a + b

    code = pycode.PyCode._from_code(space, f.func_code)
    assert can_inline(0, code)