[Python-Dev] Iterating in parallel

Ka-Ping Yee pingster@ilm.com
Wed, 12 Jul 2000 20:01:59 -0700 (PDT)


These verbs have the following meanings to me:

    >>> splice([1, 2, 3], [4, 5, 6])
    [1, 2, 3, 4, 5, 6]

    >>> weave([1, 2, 3], [4, 5, 6])
    [1, 4, 2, 5, 3, 6]

    >>> interlace([1, 2, 3], [4, 5, 6])
    [1, 4, 2, 5, 3, 6]

I also did a little surveying.  I got opinions that "interlace"
was especially misleading; "zip" was deemed to evoke compression
too strongly; and "parallel" evoked concurrency too strongly.

The people i asked generally agreed with the interpretations
i used above, though one thought that weave() would produce
[[1, 4], [2, 5], [3, 6]].

I'm afraid i have to say that "with" is a horrible name for a
function, as it's a preposition.  Verbs work best for function
names, and nouns are next best.  Prepositions are very awkward.

One person i asked even said that of all the various options,
he still liked "map(None, ...)" best because all the others had
potentially conflicting connotations.

I personally still like "zip", but i must defer to empirical
results.  "tuples" may be the clearest option.  "twine" seems
plausible (though it makes me think of twisting and rotation).

(By the way, let's not forget irange.  Go, irange, go!)


-- ?!ng