July 20, 2010
7:57 p.m.
[x for x in another_list if y < 5 where y = f(x)] [x for (x,y) in map(lambda x: (x,f(x)), another_list) if y < 5]
Or allow nested list comprehensions? [x for (x,y) in [x,f(x) for x in another_list] if y < 5] this is getting closer to LINQ... We could use line-breaks for readability: [x for (x,y) in [x,f(x) for x in another_list] if y < 5] S.