test_04_imports.py 383 Bytes
Newer Older
steinbac's avatar
steinbac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

def import_inside(name):
    import string
    return name+string.ascii_lowercase

def test_import_inside(benchmark):

    res = benchmark(import_inside,"PYTHON has a lot of syntactic sugar!")

def test_import_outside(benchmark):
    import string

    def append(name):
        return name+string.ascii_lowercase

    res = benchmark(append,"PYTHON has a lot of syntactic sugar!")