print(elapsed)
t = [{} for k in range(max_int)]
for k in range(len(a)):
    t[a[k][0]][a[k][1]] = 42
m = 100000
start_time = time.time()
for k in range(m):
    if 8 in t[3]:
        pass
elapsed = time.time() - start_time
print(elapsed)
Python tuples as keys slow?