[Python-Dev] Lockstep iteration - eureka!

Greg Ewing greg@cosc.canterbury.ac.nz
Thu, 10 Aug 2000 13:56:55 +1200 (NZST)


> It looks nice, but i'm pretty sure it won't fly.

It will! Try it:

>>> for (x in a, y in b):
  File "<stdin>", line 1
    for (x in a, y in b):
                        ^
SyntaxError: invalid syntax

> how is the parser to know whether the lockstep form has been
> invoked?

The parser doesn't have to know as long as the compiler can
tell, and clearly one of them can.

> Besides, i think Guido has Pronounced quite firmly on zip().

That won't stop me from gently trying to change his mind
one day. The existence of zip() doesn't preclude something
more elegant being adopted in a future version.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+