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


Groups > comp.lang.python > #82777

Re: List Comprehensions

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; '(b)': 0.07; 'affected': 0.07; 'modifying': 0.07; '22,': 0.09; 'thread': 0.14; 'comp': 0.16; 'wrote:': 0.18; 'mon,': 0.24; '&gt;': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'running': 0.33; 'no,': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'subject:List': 0.36; 'list': 0.37; 'depends': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'itself': 0.39; 'to:addr:python.org': 0.39; 'affect': 0.61; 'subject:skip:C 10': 0.61
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=M08zFI4aJwObgWIwBybc8V/p8Jr7hWB+DGAfjaw1dZM=; b=ux/DsFIYGDv4CBqPOfsGB35SfUFSbOz/HkwUZlBBKaMx89GJxj3A0qH52jcHrEjKxE CRPaOxHgi+2foBX42So0AXp8MbG5mqzl93GDxYOsRbseEKl/Ts+IlqEXGOb6dcnNaYEc 8vuOV/pPYMsqugXTIxWZbgpm6zNg1om6ZKJ5rQq48RHfBlC8c3PGxaMHcvCpM74tNXgj 5mR1yFLCm2QJzMo+xTc4h4H3inTdM33vKoaoVXI9+fDArzI9Y7s0sMdjptc6XS8BBdGZ q1gNa/t9NDu2+mm4xLepKzBILJaGSa1J4HSA1MEUX0kr4eda5cuI9G3RBQTnDREL3scx o3jA==
X-Received by 10.66.90.161 with SMTP id bx1mr35959831pab.35.1419261217920; Mon, 22 Dec 2014 07:13:37 -0800 (PST)
MIME-Version 1.0
In-Reply-To <5497e2a2$0$12978$c3e8da3$5496439d@news.astraweb.com>
References <mailman.17108.1419226965.18130.python-list@python.org> <5497e2a2$0$12978$c3e8da3$5496439d@news.astraweb.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Mon, 22 Dec 2014 08:12:57 -0700
Subject Re: List Comprehensions
To Python <python-list@python.org>
Content-Type multipart/alternative; boundary=001a11383b9ebce114050acf8048
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.17121.1419261227.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1419261227 news.xs4all.nl 2894 [2001:888:2000:d::a6]:55425
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82777

Show key headers only | View raw


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

On Mon, Dec 22, 2014 at 2:21 AM, Steven D'Aprano <
steve+comp.lang.python@pearwood.info> wrote:
> > (b) *   Is there anything that I need to consider while using list
> > comprehension with threads ?*
>
> That depends on what you mean by "using list comprehension with threads".
>
> If you mean "use a list comprehension inside a thread", then no, you don't
> need to be concerned. So long as your functions are pure functions with no
> side-effects, running a list comp inside one thread cannot affect any
other
> thread.

It could, however, be itself affected by other threads modifying the same
data if one isn't careful.

Back to comp.lang.python | Previous | NextPrevious 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