[PIPython] Re: ordinare un dict complicato

Carlo C8E Miron carlo.miron
Mer 13 Lug 2005 14:49:22 CEST


Di nessuna utilita' per Giovanni, limitato dal suo arcaico Python, ma volevo
puntualizzare che la soluzione piu' elegante (e probailmente efficiente, 
non ho provato) per Python >= 2.4 e'::

>>> sorted(list_genes.items(), key=lambda item:item[1][0][0])

-- 
Carlo C8E Miron, ICQ #26429731
-- 
Disclaimer:
If I receive a message from you, you are agreeing that:
1. I am by definition, "the intended recipient".
2. All information in the email is mine to do with as I see fit and
 make such financial profit, political mileage, or good joke as it
 lends itself to. In particular, I may quote it on USENET or the WWW.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that
 may be included on your message.


More information about the Python mailing list