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


Groups > comp.lang.python > #82777

Re: List Comprehensions

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 2014-12-22 08:12 -0700
Subject Re: List Comprehensions
Newsgroups comp.lang.python
Message-ID <mailman.17121.1419261227.18130.python-list@python.org> (permalink)

Show all headers | 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