On Mon, Dec 22, 2014 at 4:42 PM, Ganesh Pal <ganesh1...@gmail.com> wrote: > (a) I was trying to reduce the below piece of code using List comprehension > ? Any suggestion please let me know > > > for opt in options: > opt['result'] = Queue.Queue() > tmp_thread = pause.Thread(opt) > threads.append(tmp_thread) > tmp_thread.start() > > (b) Is there anything that I need to consider while using list > comprehension with threads ?
Your code is doing several things at once, so it's probably not worth trying to turn it into a comprehension. I don't think it needs to be shortened, anyway; looks fine to me. ChrisA -- https://mail.python.org/mailman/listinfo/python-list