List Comprehensions

Ian Kelly ian.g.kelly at gmail.com
Mon Dec 22 10:12:57 EST 2014


On Mon, Dec 22, 2014 at 2:21 AM, Steven D'Aprano <
steve+comp.lang.python at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20141222/719dda80/attachment.html>


More information about the Python-list mailing list