[Python-Dev] list comprehensions again...

Greg Stein gstein@lyra.org
Tue, 11 Jul 2000 17:09:31 -0700


On Tue, Jul 11, 2000 at 05:01:24PM -0700, Ka-Ping Yee wrote:
> On Tue, 11 Jul 2000, Greg Stein wrote:
> > On Tue, Jul 11, 2000 at 07:02:06PM -0400, Barry A. Warsaw wrote:
> [...]
> > > But wouldn't some variation on
> > > 
> > >     for x, y in a, b:
> > > 
> > > invoke resonance with the classic idiom?  Okay, now I'm reduced to
> > > arguing syntax (and syntax which I haven't thought out much :).
> > 
> > for x, y in a, b:
> > 
> > won't work. "a, b" is a tuple constructor. The for-loop will iterate over a
> > two-item tuple, and unpack each item (a and b) into the x,y variables.
> 
> That's why i suggested the above, with semicolons instead of commas.
> Other ideas for a separator symbol are welcomed... but i think the
> semicolon may be the only reasonable option left.

hehe... I have another "reasonable option"

:-)

-- 
Greg Stein, http://www.lyra.org/