On Tue, 22 Nov 2005 20:12:52 GMT in comp.lang.python, [EMAIL PROTECTED] (Bengt Richter) wrote:
>On Tue, 22 Nov 2005 13:26:45 +0100, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > >>Duncan Booth wrote: >> >>> That's funny, I thought your subject line said 'list of tuples'. I'll >>> answer the question in the subject rather than the question in the body: >>> >>> >>> aList = ['a', 1, 'b', 2, 'c', 3] >>> >>> it = iter(aList) >>> >>> zip(it, it) >>> [('a', 1), ('b', 2), ('c', 3)] >> [...] > >Hm, actually, something tells me I've seen some variation of this before, >but I can't think of the context off hand. Earlier this fall I posted a question about iterating over a sequence while modifying it. Google should bring it up. This strikes me as the same idea, only inside-out... Regards, -=Dave -- Change is inevitable, progress is not. -- http://mail.python.org/mailman/listinfo/python-list