a question regarding conciseness

Duncan Booth duncan at NOSPAMrcp.co.uk
Thu Feb 21 07:06:21 EST 2002


gerson.kurz at t-online.de (Gerson Kurz) wrote in 
news:3c74c3d6.20466328 at news.isar.de:

> I found an easier solution:
> 
> sort = lambda x:(x.sort(),x)[1]
> 
If you are heading that way:
sort = lambda x:x.sort() or x

-- 
Duncan Booth                                             duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?



More information about the Python-list mailing list