def timef(f, *args):
    return timeit.timeit(lambda : f(*args), number=1000000)
tests = {'addition': lambda x: x + 17, 'substraction': lambda x: x - 17,
    'multiplication': lambda x: x * 17, 'division': lambda x: x / 17,
    'float division': lambda x: x / 17.0}
for name, f in list(tests.items()):
    print('int {0}'.format(name).ljust(20), timef(f, 0))
print('long {0}'.format(name).ljust(20), timef(f, 10 ** 50))
print()
How are bignums represented internally?