"Frank Millman" <fr...@chagford.com> writes: > dict((a, b) for a, b in zip(x, y)) > 100000 loops, best of 3: 16.1 usec per loop > {a: b for a, b in zip(x, y)}" > 100000 loops, best of 3: 6.38 usec per loop
Hmm, I bet the difference is from the (a,b) consing all those tuples. Can you try just dict(zip(x,y)) ? -- https://mail.python.org/mailman/listinfo/python-list