Modernize code to Python 3.6+ and some cleanup
This commit is contained in:
@@ -10,7 +10,7 @@ def non_ascii(c):
|
||||
|
||||
def clock(label, cmd):
|
||||
res = timeit.repeat(cmd, setup=SETUP, number=TIMES)
|
||||
print(label, *('{:.3f}'.format(x) for x in res))
|
||||
print(label, *(f'{x:.3f}' for x in res))
|
||||
|
||||
clock('listcomp :', '[ord(s) for s in symbols if ord(s) > 127]')
|
||||
clock('listcomp + func :', '[ord(s) for s in symbols if non_ascii(ord(s))]')
|
||||
|
||||
Reference in New Issue
Block a user