a question regarding conciseness

Remco Gerlich scarblac at pino.selwerd.nl
Thu Feb 21 18:45:45 CET 2002


Gerson Kurz <gerson.kurz at t-online.de> wrote in comp.lang.python:
> I found an easier solution:
> 
> sort = lambda x:(x.sort(),x)[1]

def sort(x): x.sort(); return x

is equally concise and doesn't have to do the odd tuple thing :)

-- 
Remco Gerlich



More information about the Python-list mailing list