[Python-Dev] Re: Adding any() and all()

Nicolas Fleury nidoizo at yahoo.com
Sat Mar 12 22:58:29 CET 2005


Reinhold Birkenfeld wrote:
> """
> He proposes that
> 
> [x in list if x > 0]
> 
> (which is currently undefined) be exactly equal to:
> 
> [x for x in list if x > 0]
> """
> 
> What about that?

But [x in list] means already something.
Supporting [x in list if condition] will complicate the parser and will 
be error-prone if someone remove the condition.  It will make more sense 
to me to support that syntax instead (unless I miss something):

[for x in list if x > 0]

Regards,
Nicolas



More information about the Python-Dev mailing list