Serhiy Storchaka added the comment:

And here is a synthetic microbenchmark:

$ ./python -m timeit -s "n=10**3; k=2; a={(i,)*k:i for i in range(n)}; 
b={(i,)*k:i for i in range(n)}"  "a == b"

Vanilla: 251 usec per loop
Patched: 195 usec per loop

$ ./python -m timeit -s "n=10**3; k=2; a={(i,)*k:i for i in range(n)}; 
b=dict(a)"  "a == b"

Vanilla: 116 usec per loop
Patched: 58.6 usec per loop

The use of tuple keys is quite common.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to