a query on sorting

Fredrik Lundh fredrik at pythonware.com
Sun Oct 1 14:55:06 EDT 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.

</F>




More information about the Python-list mailing list