[Python-ideas] filter

Adam Atlas adam at atlas.st
Mon Sep 28 01:24:10 CEST 2009


How would that be different from [f(x) for x in u if cond(x)]?

- Adam


On 27 Sep 2009, at 19:20, Josef Eschgfaeller wrote:

> It would be nice to have a syntax like
>
>    [f(x) for x in u and cond(x)]
>
> instead of list(map(f,filter(cond,u))).
>
> For avoiding interference with a common and it could be
>
>    [f(x) for x in u andcond cond(x)]
>
> or perhaps
>
>    [f(x) for x in u with cond(x)]
>
> if this is not interfering.
>
> Josef Eschgfaeller
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas




More information about the Python-ideas mailing list