[Python-Dev] PEP 201, zip() builtin

Tim Peters tim_one at email.msn.com
Sat Jul 29 16:32:56 EDT 2000


[Ben Wolfson]
> I take it, then, that lock-step iteration will be done with zip()?

Yes.

> That seems too bad,

Yes, but not a first-class disaster <wink>.

> because it the existing Python syntax could be modified to create
> easily-understood (to me, anyway) ways of expressing both parallel
> and lock-step iteration:

No, every attempt to do so has failed.  For example,

> parallel:
> for x in sequence1, y in sequence2:
> 	stuff
>
> lock-step:
> for x, y in sequence1, sequence2:
> 	stuff

Both syntaxes already have well-defined meanings in Python (*try* them!), so
we can't change what they mean without breaking existing code.  Guido would
*prefer* to do this via syntax instead of new functions, but in more than a
year nobody has been able to dream up a reasonable syntax that's
backward-compatible.    That's not for lack of trying.

maybe-in-p3k-ly y'rs  - tim






More information about the Python-list mailing list