News for hackers. Stuff that matters.
Re:Ask PG: What's The Most Points One Submission Has Ever Re... by ivankirigin on Tuesday May 12, 2009 @02:00PM (#605855)
Just in case it isn't clear, that order_by actually digs into the database layer to do the sorting there. It's a query that returns an iterator that gives you stories in that order one at a time.

To sort an existing list, over a particular member, it would be

  Stories.sort( key = lambda x: x.score )
That lambda has certainly confused a lot of people I know. Probably because they used the word "lambda" and not "function".

There are no comments on this comment yet.