Re: [Python-ideas] if in for-loop statement

Hello, why not using the filter function? for x in filter(is_prime, range(100)): # do something with x This is equivalent as was mentionned at first: for x in range(100) if is_prime(x): # do things with x Régis -- Régis Martin Directeur de Projets Astek Industrie Tel: 06-83-53-15-05 http://www.groupeastek.com/

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). H-J On 23 February 2017 at 18:11, Régis Martin <rmartin@astek.fr> wrote:

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). H-J On 23 February 2017 at 18:11, Régis Martin <rmartin@astek.fr> wrote:
participants (2)
-
Henk-Jaap Wagenaar
-
Régis Martin