
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

On Sun, Sep 27, 2009 at 6:20 PM, Josef Eschgfaeller <esg@unife.it> wrote:
It would be nice to have a syntax like
[f(x) for x in u and cond(x)]
If I understand what you're asking for, Python already supports this. The syntax is: [f(x) for x in u if cond(x)] -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>

On Sun, Sep 27, 2009 at 6:20 PM, Josef Eschgfaeller <esg@unife.it> wrote:
It would be nice to have a syntax like
[f(x) for x in u and cond(x)]
If I understand what you're asking for, Python already supports this. The syntax is: [f(x) for x in u if cond(x)] -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
participants (3)
-
Adam Atlas
-
Daniel Stutzbach
-
Josef Eschgfaeller