<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 30, 2015 at 6:58 PM, Yury Selivanov <span dir="ltr"><<a href="mailto:yselivanov.ml@gmail.com" target="_blank">yselivanov.ml@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><br>
<br>
On 2015-04-30 5:48 AM, Todd wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
For example, you could create a multiprocessing pool, and let the pool<br>
handle the items in a "for" loop, like so:<br>
<br>
from multiprocessing import Pool<br>
<br>
mypool = Pool(10, maxtasksperchild=2)<br>
<br>
mypool for item in items:<br>
</blockquote>
<br>
<br></span>
This looks "OK" for a simple snippet, but how will you define<br>
this new syntax in Python grammar?<br>
<br>
Unless you restrict such syntax to use only NAME tokens before<br>
'for', you can easily expect users to write code like this:<br>
<br>
some_namespace.module.function(arg=123) for item in items():<br>
...<span class=""><font color="#888888"><br>
</font></span></blockquote><div><br></div><div>pep8, probably. You can write ugly code now. This isn't much better:<br> <br> some_namespace.module.function(arg=123).map(items())</div></div><br></div></div>