[Python-3000] Parallel iteration syntax

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 31 02:32:06 CEST 2006


Fabien Schwob wrote:

> for x in iter1 and y in iter2:

It would be tricky to avoid having that
parsed as

   for x in (iter1 and y in iter2):

since 'in' is also a valid part of an expression.
That's one of ther reasons I suggested parens
around the whole thing, which would make it
unambiguous.

The other reason was to try to make it look
more like parallel than nested iteration, but
it seems this is too subtle a clue for some
people.

--
Greg



More information about the Python-3000 mailing list