javuchi wrote: > I want to avoid converting the dictionary to a list and then to a > dictionay. Are there speed penalties for such a conversion?
You mean, is it faster to write, test, debug and execute slow Python code rather than letting Python's built-in routines written in fast C do the job? I have no idea. Perhaps you should try it and see. Write some code to do it all manually, and time it. Make sure you use realistic test data: if your users will be using dictionaries with 10,000 items, there is no point in testing only dictionaries with 10 items. For accuracy, run (say) 20 tests, and look at the average speed. Of better still, use the timeit module. -- Steven. -- http://mail.python.org/mailman/listinfo/python-list