[EMAIL PROTECTED]: > As for the original prooblem, why not use > defaultdict? I think it's the most idiomatic way to achieve what we > want. And also the fastest one, according to my quick-and-dirty tests:
It adds the new keys, I can't accept that: >>> from collections import defaultdict as dd >>> adict = {1:2, 3:4} >>> addict = dd(lambda: None, adict) >>> r = addict[10] >>> addict defaultdict(<function <lambda> at 0x008E6FB0>, {1: 2, 10: None, 3: 4}) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list