Sorting by item_in_another_list

Gabriel Genellina gagsl-py at yahoo.com.ar
Tue Oct 24 11:31:26 EDT 2006


At Tuesday 24/10/2006 04:35, Cameron Walsh wrote:

> > c = set(B)
> > a.sort(key=c.__contains__, reverse=True)
> >
> > Tim Delaney
>
>Depressingly simple.  I like it.

...and fast!


-- 
Gabriel Genellina
Softlab SRL 

__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar



More information about the Python-list mailing list