For review: PEP 308 - If-then-else expression

Ben Wolfson wolfson at uchicago.edu
Mon Feb 10 21:58:08 EST 2003


On Tue, 11 Feb 2003 15:34:23 +1300, Greg Ewing (using news.cis.dfn.de)
wrote:

> I'm not sure, but it may even be a theorem that any nested LC can be
> re-written as a non-nested LC by pulling all the loops out to the top
> level and combining the target expressions appropriately.

Does that include cases where the nesting is in the value-producing part,
like 
  [[x/3.0 for x in range(y)] for y in blah]
?

-- 
I certainly seem to be enjoying myself in the same way, smacking my
lips, sighing and moaning, dripping [REDACTED] on my shirt and
smearing it into my moustache ... But ... If I snuck a lick of your
cone, I wouldn't smack my lips. -- Ted Cohen





More information about the Python-list mailing list