a question regarding conciseness

Grant Edwards grante at visi.com
Thu Feb 21 18:00:01 CET 2002


In article <Xns91BC7AB03699duncanrcpcouk at 127.0.0.1>, Duncan Booth wrote:
> 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

Assuming you never run into an "x" that returns a true value
from its sort method...

-- 
Grant Edwards                   grante             Yow!  Look DEEP into the
                                  at               OPENINGS!! Do you see any
                               visi.com            ELVES or EDSELS... or a
                                                   HIGHBALL??...



More information about the Python-list mailing list