Converting a flat list to a list of tuples

David Isaac aisaac0 at verizon.net
Tue Nov 22 09:28:56 EST 2005


"Duncan Booth" <duncan.booth at invalid.invalid> wrote in message
news:Xns971671CB0DA43duncanbooth at 127.0.0.1...
> >>> aList = ['a', 1, 'b', 2, 'c', 3]
> >>> it = iter(aList)
> >>> zip(it, it)
> [('a', 1), ('b', 2), ('c', 3)]

That behavior is currently an accident.
http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1121416
Alan Isaac





More information about the Python-list mailing list