Sort a list on your own criteria with Python Posted by puttsmcfadden on Tuesday May 31, 2011 @09:22AM from the pythonicprose.blogspot.com dept. http://pythonicprose.blogspot.com/2009/09/python-custom-sort-list.html ( 1 comment | 3 points | on HN )
His call to sort reads like this:
alist.sort(mysort)
The ordering function doesn't sort, it orders. I would have called the ordering function myorder, so the call would read:
alist.sort(myorder)
More specifically, his ordering function orders by length, so even better would be:
alist.sort(orderByLength)