
June 21, 2009
4:59 p.m.
2009/6/21 Lie Ryan <lie.1296@gmail.com>:
It can even be done as a single expression without (IMO) significantly affecting readability::
result = [ b for (a, b) in ((x, 3*x**2-5*x+4) for x in seq if x % 3 != 2) if -a < b < a]
IMHO, when a comprehension requires more than a single line, it should turn into explicit loop.
Hang on - isn't the whole point of this thread that, in your opinion, when a comprehension gets complex, it requires new syntax? :-) Paul.