[Python-Dev] Iterating in parallel

Skip Montanaro skip@mojam.com (Skip Montanaro)
Thu, 13 Jul 2000 09:22:32 -0500 (CDT)


    Ping> It seems clear that the most common use of this thing is in a
    Ping> parallel-iteration idiom, and that it would be quite rarely used
    Ping> as part of an expression elsewhere.  Given that, consider:

    Ping>     for x, y, z in marry(a, b, c): print x + y + z
    Ping>     for x, y, z in twine(a, b, c): print x + y + z
    Ping>     for x, y, z in lace(a, b, c): print x + y + z
    Ping>     for x, y, z in zip(a, b, c): print x + y + z
    Ping>     for x, y, z in parallel(a, b, c): print x + y + z

    Ping> Which one makes its behaviour most obvious to you?  

    for x, y, z in stitch(a, b, c): print x + y + z

;-)

-- 
Skip Montanaro, skip@mojam.com, http://www.mojam.com/, http://www.musi-cal.com/
"To get what you want you must commit yourself for sometime" - fortune cookie