<div dir="ltr">I think, in that particular example, that is an ok solution, however if you are combining multiple booleans to create a lambda or separate function that is quite a bit of syntactical sugar to add (unless it is re-used).<div><br></div><div>H-J<br><div class="gmail_extra"><br><div class="gmail_quote">On 23 February 2017 at 18:11, Régis Martin <span dir="ltr"><<a href="mailto:rmartin@astek.fr" target="_blank">rmartin@astek.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
why not using the filter function?<br>
<br>
for x in filter(is_prime, range(100)):<span class=""><br>
# do something with x<br>
<br></span>
This is equivalent as was mentionned at first:<span class="im HOEnZb"><br>
<br>
for x in range(100) if is_prime(x):<br></span><div class="HOEnZb"><div class="h5">
# do things with x<br>
<br></div></div><span class="HOEnZb"><font color="#888888">
Régis<br>
<br>
-- <br>
Régis Martin<br>
Directeur de Projets Astek Industrie<br>
Tel: 06-83-53-15-05<br>
<a href="http://www.groupeastek.com/" rel="noreferrer" target="_blank">http://www.groupeastek.com/</a><br>
<br>
</font></span><br>______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br></blockquote></div><br></div></div></div>