Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'skip:[ 20': 0.04; 'params': 0.09; 'thread': 0.14; '-tkc': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'iterating': 0.16; 'shorten': 0.16; 'subject:requests': 0.16; 'wrote:': 0.18; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'could': 0.34; 'charset:us-ascii': 0.36; 'list': 0.37; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:50.22': 0.84 Date: Thu, 3 Oct 2013 11:42:05 -0500 From: Tim Chase To: python-list@python.org Subject: Re: feature requests In-Reply-To: References: <6782f295-1885-4114-aea8-d785480f3489@googlegroups.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: none X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380818430 news.xs4all.nl 15878 [2001:888:2000:d::a6]:39652 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55420 On 2013-10-04 02:21, Chris Angelico wrote: > > workers = [] > > for params in whatever: > > thread = threading.Thread(params) > > thread.start() > > workers.append(thread) > > You could shorten this by iterating twice, if that helps: > > workers = [Thread(params).start() for params in whatever] > for thrd in workers: thrd.start() Do you mean workers = [Thread(params) for params in whatever] for thrd in workers: thrd.start() ? ("Thread(params)" vs. "Thread(params).start()" in your list comp) -tkc