Skip Montanaro <[EMAIL PROTECTED]> wrote: > Roy> BTW, does Python really build the intermediate list and throw it > Roy> away after using it to initialize the dictionary, or is it smart > Roy> enough to know that it doesn't really need to build the whole list > Roy> in memory? > > That's why I called .iteritems() in my example. It won't generate the > entire list of tuples as .items() would.
I know it won't generate the list of items from the forward dict, but I was thinking of the list generated by the list comprehension, passed as the argument to the reverse dict constructor. That's the throw-away list I was thinking of (see Tim Delaney's response to my post). -- http://mail.python.org/mailman/listinfo/python-list