[EMAIL PROTECTED] wrote: >> Consider a dictionary with one million items. The following operations >> >> k = d.keys() >> v = d.values() >> >> creates two list objects, while >> >> i = d.items() >> >> creates just over one million objects. In your "equivalent" example, > > Sorry. I lose you here. Could you explain in detail what do you mean by > "two list objects" vs one million objects ? >
It should be fairly clear. 'd.keys()' creates one new object (a list). 'd.items()' creates a list of tuples, so that is one new list and one million new tuples. -- http://mail.python.org/mailman/listinfo/python-list