[Python-Dev] list comprehensions again...

Thomas Wouters thomas@xs4all.net
Tue, 11 Jul 2000 21:51:00 +0200


On Tue, Jul 11, 2000 at 12:26:54PM -0700, Ka-Ping Yee wrote:

> This would then be directly reminiscent of
> 
>     for x; y in (1, 2, 3, 4, 5, 6); "abc":
>         for z in "de":
>             list.append((x, y+z))
> 
> which provides the appropriate meaning.

> I don't like extra punctuation, but i'm not sure what else to do
> here since "for" alone is a very weak separator.

Agreed, though I think ';' is the wrong punctuation for this... It's always
been a statement-seperator, and now it's used to seperate parts of a
statement, like a normal comma. I still think 'for x in a; y in b' is better
than this, but I'm not sure how to liase it with list comprehensions'
"nested for". But then, I'm not sure about any of the list comp syntax right
now :-) To paraphrase Guido, I got myself in quite a mess ;-)

Anyone object if I pull this discussion into c.l.py ? I'm not sure if any
new ideas pop up, but it might give some more data to work with ;-P And I
don't think any of this is urgent in any way, I doubt anything more will get
done until after ORA OSCON, anyway. And maybe some of you guys that are
actually going there can discuss it face to face ;-P

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!