read_nonlocal = make_nonlocal_reader()

def read_global(trials=trials):

v_global; v_global; v_global; v_global; v_global

def read_builtin(trials=trials):

+def read_classvar(trials=trials, A=A):

+ A.x; A.x; A.x; A.x; A.x

+ A.x; A.x; A.x; A.x; A.x

+ A.x; A.x; A.x; A.x; A.x

+ A.x; A.x; A.x; A.x; A.x

+ A.x; A.x; A.x; A.x; A.x

+def read_instancevar(trials=trials, a=A()):

+ a.x; a.x; a.x; a.x; a.x

+ a.x; a.x; a.x; a.x; a.x

+ a.x; a.x; a.x; a.x; a.x

+ a.x; a.x; a.x; a.x; a.x

+ a.x; a.x; a.x; a.x; a.x

def write_local(trials=trials):

v_global = None; v_global = None; v_global = None; v_global = None; v_global = None

v_global = None; v_global = None; v_global = None; v_global = None; v_global = None

+def write_classvar(trials=trials, A=A):

+ A.x = None; A.x = None; A.x = None; A.x = None; A.x = None

+ A.x = None; A.x = None; A.x = None; A.x = None; A.x = None

+ A.x = None; A.x = None; A.x = None; A.x = None; A.x = None

+ A.x = None; A.x = None; A.x = None; A.x = None; A.x = None

+ A.x = None; A.x = None; A.x = None; A.x = None; A.x = None

+def write_instancevar(trials=trials, a=A()):

+ a.x = None; a.x = None; a.x = None; a.x = None; a.x = None

+ a.x = None; a.x = None; a.x = None; a.x = None; a.x = None

+ a.x = None; a.x = None; a.x = None; a.x = None; a.x = None

+ a.x = None; a.x = None; a.x = None; a.x = None; a.x = None

+ a.x = None; a.x = None; a.x = None; a.x = None; a.x = None

def loop_overhead(trials=trials):

for f in [read_local, read_nonlocal, read_global, read_builtin,

- write_local, write_nonlocal, write_global, loop_overhead]:

- print(min(Timer(f).repeat(7, 1000)), f.__name__, sep='\t')

+ read_classvar, read_instancevar,

+ write_local, write_nonlocal, write_global,

+ write_classvar, write_instancevar,

+ print('{:5.3f}\t{}'.format(min(Timer(f).repeat(7, 1000)), f.__name__))