Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!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.013 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'skip:[ 20': 0.04; 'lines:': 0.09; 'params': 0.09; 'thread': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'iterating': 0.16; 'shorten': 0.16; 'subject:requests': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'fri,': 0.33; "i'd": 0.34; 'could': 0.34; 'received:google.com': 0.35; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'ugly,': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=0c3bKQyFMxb5asYESgusL52Et/uVpoaQMLYarlNCnbY=; b=MYIF4BLZ2Gqgn1umYq2FfQrlVZlwJ3FD/LKGNd1+2V2uMmmwPfSMllVFP7guKV7FXJ ReLZEgBvL5Vzr0ozWunpTHY/7GoRT3XIdW4JKD+9EbTnPywLzIrbJ4Xymf0ho4WYHUYC OFxjPdRtmXVF/iyRxaJ1/yDLk0M+XfFpWHkAr8ZTbABaycMcUiRGMiy7c03ym4n0JPio ymHFdPiBe6RIUwLHf4DoSzjHkq/sxK91c4a5qKM+B38gTA6Wu7sGoSLxBD1UubgtINVT IF/r+Pe2Zx4w8rRiv2ZMXCEao/jGDoscegKrahxRrZ6Xu/JnBda5GjggLUXBTQ+baRTD myTw== MIME-Version: 1.0 X-Received: by 10.67.4.197 with SMTP id cg5mr10436544pad.10.1380817273869; Thu, 03 Oct 2013 09:21:13 -0700 (PDT) In-Reply-To: <6782f295-1885-4114-aea8-d785480f3489@googlegroups.com> References: <6782f295-1885-4114-aea8-d785480f3489@googlegroups.com> Date: Fri, 4 Oct 2013 02:21:13 +1000 Subject: Re: feature requests From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1380817277 news.xs4all.nl 15963 [2001:888:2000:d::a6]:36361 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:55419 On Fri, Oct 4, 2013 at 2:12 AM, macker wrote: > I'd like to be able to `workers = [Thread(params).start() for params in whatever]`. Right now, it's 5 ugly, menial lines: > > 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() ChrisA