Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82751

List Comprehensions

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!bcyclone05.am1.xlned.com!bcyclone05.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ganesh1pal@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.135
X-Spam-Level *
X-Spam-Evidence '*H*': 0.75; '*S*': 0.02; '(b)': 0.07; '\xc2\xa0i': 0.16; 'trying': 0.19; 'to:name:python-list@python.org': 0.22; '(a)': 0.24; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'piece': 0.31; 'received:google.com': 0.35; 'there': 0.35; 'options:': 0.36; 'subject:List': 0.36; 'list': 0.37; 'to:addr :python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'subject:skip:C 10': 0.61; '8bit%:10': 0.64; 'opt': 0.97
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=SN6QU1DQNvBLaSZkk15Xj0XvsehJmqtmuVwLpBfHw30=; b=Rfe7IzdzbWIDhGZtU21djVstDKoOaHrw04YBuwta0fYGOAdgoggRcmfWxXSvNLab3C mVYwvGsHBvAogb7Rpru1mReqpfTZK+oDP+PXrxgRuQOCoarawR5VXPCrIOcVTyazEYFa B06HLHuQMnEiyt+Zy7C+c6HjNG71NG1Z1wx8j9LgiDtiNOjcf/RxvVdvbY2BGimCKJxF RwlwFotSpOrmcg8+dgWAuo9RbMot2+X+QXAUUVKsF8nkRwykwSxCG/5NmllAwHRQDa5A 52f5zNX3YJoR1PjYKwXyXytL4coXphUx+/J0z/dhqlr9TVcg7FDv7NX2Czhrnu1JJl7z TZjA==
MIME-Version 1.0
X-Received by 10.152.197.5 with SMTP id iq5mr20106107lac.6.1419226956991; Sun, 21 Dec 2014 21:42:36 -0800 (PST)
Date Mon, 22 Dec 2014 11:12:36 +0530
Subject List Comprehensions
From Ganesh Pal <ganesh1pal@gmail.com>
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=001a11341530a090f6050ac7866f
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17108.1419226965.18130.python-list@python.org> (permalink)
Lines 48
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1419226965 news.xs4all.nl 2919 [2001:888:2000:d::a6]:39372
X-Complaints-To abuse@xs4all.nl
X-Received-Bytes 4655
X-Received-Body-CRC 1002799289
Xref csiph.com comp.lang.python:82751

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi ,


(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 ?*


Regards,

Ganesh

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

List Comprehensions Ganesh Pal <ganesh1pal@gmail.com> - 2014-12-22 11:12 +0530
  Re: List Comprehensions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-22 20:21 +1100
    Re: List Comprehensions Chris Angelico <rosuav@gmail.com> - 2014-12-22 20:45 +1100
      Re: List Comprehensions Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-12-23 02:18 +1100
        Re: List Comprehensions Chris Angelico <rosuav@gmail.com> - 2014-12-23 04:10 +1100
        Re: List Comprehensions Terry Reedy <tjreedy@udel.edu> - 2014-12-22 15:28 -0500
    Re: List Comprehensions Ian Kelly <ian.g.kelly@gmail.com> - 2014-12-22 08:12 -0700

csiph-web