Parameter sublists [was: An ordering question]

2009-03-13 Thread Peter Pearson
On Fri, 13 Mar 2009 18:56:30 +0100, Hrvoje Niksic hnik...@xemacs.org wrote: [snip] a.sort(key=lambda (x, y): b[y - 1], reverse=True) Huh? I had no idea one could do this: def g( ( ( x, y ), z ) ): ... return y ... g( ((1,2),3) ) 2 What should I have read to learn that trick? -- To

Re: Parameter sublists [was: An ordering question]

2009-03-13 Thread Chris Rebert
On Fri, Mar 13, 2009 at 5:30 PM, Peter Pearson ppear...@nowhere.invalid wrote: On Fri, 13 Mar 2009 18:56:30 +0100, Hrvoje Niksic hnik...@xemacs.org wrote: [snip] a.sort(key=lambda (x, y): b[y - 1], reverse=True) Huh?  I had no idea one could do this: def g( ( ( x, y ), z ) ): ...   return

Re: Parameter sublists [was: An ordering question]

2009-03-13 Thread Kottiyath
On Mar 14, 5:39 am, Chris Rebert c...@rebertia.com wrote: On Fri, Mar 13, 2009 at 5:30 PM, Peter Pearson ppear...@nowhere.invalid wrote: On Fri, 13 Mar 2009 18:56:30 +0100, Hrvoje Niksic hnik...@xemacs.org wrote: [snip] a.sort(key=lambda (x, y): b[y - 1], reverse=True) Huh?  I had