On Aug 15, 11:45 am, [EMAIL PROTECTED] wrote: > by the way, iterating over bar will throw KeyError if that key does not exist > in foo. to see that in action, simply set another key in bar after > copy.deepcopy stmt in this example.. > bar['xtra'] = 0 > and re-run....
My first posting in this thread, about 4 days ago, was in essence: "The OP asserts that foo keys are a superset of bar keys. If that assertion is not true (i.e. there are keys in bar that are not in foo, your [Calvin's] code [iterating over foo] will silently ignore them whereas mine [iterating over bar] will cause an exception to be raised (better behaviour IMHO)". Your point is ...? -- http://mail.python.org/mailman/listinfo/python-list