The shorter version: This doesn't need any x = iter(list) line. perhaps more useful if you have a bunch of lists to be converted through out your code.
def dictit(lyst):
i = 0
while i < len(lyst):
yield lyst[i], lyst[i+1]
i = i + 2
l = [1, 2, 3, 4, 5, 6, 7, 'a', 8, 'b']
{d[0]:d[1] for d in dictit(l)} 3 again a dict comprehension
func = lambda l: {k[0]:k[1] for k in dictit(l)}
d = func(l)
--
http://mail.python.org/mailman/listinfo/python-list
