On Thu, 12 Dec 2013 00:59:42 +0000, MRAB wrote: >> table = [(x, i) for i,x in enumerate(iterable)] >> table.sort() > > This looks wrong to me: > >> for x, i in table: >> table[i] = x
Yes, you're right, I over-simplified the example, and in doing so introduced a bug. What I actually use is: for i, x in enumerate(table): table[i] = x[1] modulo any further bugs introduced while copying and pasting :-) -- Steven -- https://mail.python.org/mailman/listinfo/python-list