a query on sorting

Fredrik Lundh fredrik at pythonware.com
Sun Oct 1 20:55:06 CEST 2006

Scott David Daniels wrote:

>> map(tuple,map(reversed,list(enumerate(a))))
> Doesn't the following read more easily?
>      [tuple(reversed(x)) for x in enumerate(a)]

that involves two extra name lookups for each item in the sequence, 
though, so it doesn't execute more easily.


More information about the Python-list mailing list