[Python-3000] Parallel iteration syntax

Adam DePrince adam.deprince at gmail.com
Tue Mar 28 16:29:56 CEST 2006


On Tue, 2006-03-28 at 17:04 +1200, Greg Ewing wrote:
> Some years ago there was a long discussion about extending
> the for-loop to express parallel iteration over a number
> of iterables, which ended with the conclusion that such
> an extension was syntactically impossible, and the creation
> of zip().
> 
> Slightly too late for consideration, I did come up with
> what I believe is a backwards-compatible syntax extension
> to support this:
> 
>    for (x in iter1, y in iter2):
>      ...
> 
> This is currently a syntax error, so there is no clash
> with existing semantics.
> 
> I'm mentioning it here again just in case anyone wants
> to consider it for Py3k. I still believe it would be
> nice to have a direct syntax for parallel iteration
> to avoid the overhead of using zip or iterzip.

Does this save any overhead, other than the mental state of
programmers?  


Cheers - Adam DePrince



More information about the Python-3000 mailing list